Documentation / @warp-drive/build-config / index / setConfig
Function: setConfig()
Call Signature
function setConfig(macros, config): void;
Defined in: index.ts:279
Sets the build configuration for WarpDrive that ensures environment specific behaviors are activated/deactivated and enables adjusting log instrumentation, removing code that supports deprecated features, enabling canary features and enabling/disabling optional features.
The library uses @embroider/macros to perform this final configuration code transform.
This is a low level API for configuring WarpDrive. If your project does not use @embroider/macros
then you should use babelPlugin instead of this function.
Example
import { setConfig } from '@warp-drive/core/build-config';
import { buildMacros } from '@embroider/macros/babel';
const Macros = buildMacros({
configure: (config) => {
setConfig(config, {
compatWith: '5.6'
});
},
});
export default {
plugins: [
// babel-plugin-debug-macros is temporarily needed
// to convert deprecation/warn calls into console.warn
[
'babel-plugin-debug-macros',
{
flags: [],
debugTools: {
isDebug: true,
source: '@ember/debug',
assertPredicateIndex: 1,
},
},
'ember-data-specific-macros-stripping-test',
],
...Macros.babelMacros,
],
};
Parameters
macros
object
config
Returns
void
Call Signature
function setConfig(
context,
appRoot,
config): void;
Defined in: index.ts:280
Sets the build configuration for WarpDrive that ensures environment specific behaviors are activated/deactivated and enables adjusting log instrumentation, removing code that supports deprecated features, enabling canary features and enabling/disabling optional features.
The library uses @embroider/macros to perform this final configuration code transform.
This is a low level API for configuring WarpDrive. If your project does not use @embroider/macros
then you should use babelPlugin instead of this function.
Example
import { setConfig } from '@warp-drive/core/build-config';
import { buildMacros } from '@embroider/macros/babel';
const Macros = buildMacros({
configure: (config) => {
setConfig(config, {
compatWith: '5.6'
});
},
});
export default {
plugins: [
// babel-plugin-debug-macros is temporarily needed
// to convert deprecation/warn calls into console.warn
[
'babel-plugin-debug-macros',
{
flags: [],
debugTools: {
isDebug: true,
source: '@ember/debug',
assertPredicateIndex: 1,
},
},
'ember-data-specific-macros-stripping-test',
],
...Macros.babelMacros,
],
};
Parameters
context
object
appRoot
string
config
Returns
void