Skip to content

Instantly share code, notes, and snippets.

Created October 20, 2016 09:56
Show Gist options
  • Save anonymous/819cb2f5c9cbb8fd721c8d981e18680e to your computer and use it in GitHub Desktop.
Save anonymous/819cb2f5c9cbb8fd721c8d981e18680e to your computer and use it in GitHub Desktop.
Fast hack for electrode to load custom webpack.config.js
```
Add this function somewhere in file: "electrode/node_modules/electrode-archetype-react-app/config/webpack/base.js"
```
function webpackCustomConfig() {
var webpackPath = Path.join(context, "webpack.config.js");
/* eslint-disable no-console, global-require */
try {
return require(webpackPath);
} catch (ex) {
console.log("Webpack configuration is not found, using default webpack...");
}
/* eslint-enable no-console, global-require */
return {};
}
```
Change
```
module.exports = _.flow(
mergeWebpackConfig.bind(null, {}, baseConfig),
...
);
```
to
```
module.exports = _.flow(
mergeWebpackConfig.bind(null, {}, baseConfig, webpackCustomConfig()),
...
);
```
Create "webpack.config.js" in "client" directory, install webpack sass loaders and add the following for sass enable:
```
module.exports = {
module: {
loaders: [
{
test: /\.scss$/,
loaders: ["style", "css", "sass"]
}
]
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment