Last active
November 22, 2016 10:12
-
-
Save bjarneo/81cd95c8334eda83b26d2c9b35ac0870 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The function defined for the Webpack key should return an object that will be merged with the existing configuration.