Skip to content

Instantly share code, notes, and snippets.

@faceyspacey
Last active July 31, 2017 07:04
Show Gist options
  • Save faceyspacey/fd0456b27ab97a2d6a5211738305469f to your computer and use it in GitHub Desktop.
Save faceyspacey/fd0456b27ab97a2d6a5211738305469f to your computer and use it in GitHub Desktop.
Universal node externals strategy
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