Created
October 20, 2016 09:56
-
-
Save anonymous/819cb2f5c9cbb8fd721c8d981e18680e to your computer and use it in GitHub Desktop.
Fast hack for electrode to load custom webpack.config.js
This file contains 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
``` | |
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