Last active
July 31, 2017 07:04
-
-
Save faceyspacey/fd0456b27ab97a2d6a5211738305469f to your computer and use it in GitHub Desktop.
Universal node externals strategy
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
externals: !isNode ? [] : | |
fs.readdirSync(path.resolve(__dirname, '../../node_modules')) | |
.filter( | |
x => !/\.bin|react-universal-component|webpack-flush-chunks|^normalize.css/.test(x), | |
) | |
.reduce((externals, mod) => { | |
externals[mod] = `commonjs ${mod}`; // eslint-disable-line | |
return externals; | |
}, {}), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment