Skip to content

Instantly share code, notes, and snippets.

@miguelrincon
Created March 22, 2017 07:38
Show Gist options
  • Save miguelrincon/4d12a5bfb6113c3d20b757bde78dc968 to your computer and use it in GitHub Desktop.
Save miguelrincon/4d12a5bfb6113c3d20b757bde78dc968 to your computer and use it in GitHub Desktop.
Use webpack and bower together easily
// Webpack by default resolves modules from the ./node_modules
// directory (and up in the directory structure). We can make
// it so it finds modules in bower_components as well.
// Using both node_modules and bower_components allows for a
// gradual migration from bower to npm, allowing to move
// packages one at a time without major impact.
var path = require('path');
module.exports = {
// ...
resolve: {
modules: [
'node_modules',
path.join(process.cwd(), 'bower_components')
]
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment