Skip to content

Instantly share code, notes, and snippets.

@bjarneo
Last active November 22, 2016 10:12
Show Gist options
  • Save bjarneo/81cd95c8334eda83b26d2c9b35ac0870 to your computer and use it in GitHub Desktop.
Save bjarneo/81cd95c8334eda83b26d2c9b35ac0870 to your computer and use it in GitHub Desktop.
module.exports = {
settings: {
runtime: { /* ... */ },
build: { /* ... */ },
},
webpack: (target) => {
const settings = require('roc').getSettings();
console.log(target); // web or node
console.log(settings); // roc settings
const config = {
plugins: [
// plugin one,
// plugin two
]
};
// This config will be merged with existing config
return config;
}
};
// Or keep it simple:
module.exports = {
settings: {
runtime: { /* ... */ },
build: { /* ... */ },
},
webpack: {
plugins: [
// plugin one,
// plugin two
]
}
};
@dlmr
Copy link

dlmr commented Nov 22, 2016

It's also possible to define a object directly and not use a function. This is documented when running roc docs in Configuration.md.

@dlmr
Copy link

dlmr commented Nov 22, 2016

The function defined for the Webpack key should return an object that will be merged with the existing configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment