Skip to content

Instantly share code, notes, and snippets.

@lkacenja
Last active February 10, 2016 17:32
Show Gist options
  • Save lkacenja/84e98c879802e1832e63 to your computer and use it in GitHub Desktop.
Save lkacenja/84e98c879802e1832e63 to your computer and use it in GitHub Desktop.
Webpack config for using global node modules on mac os 10.9
// Don't forget export NODE_PATH=/usr/lib/node_modules:$NODE_PATH
var path = require("path");
var pathToModules = path.resolve("/usr/local/lib/node_modules");
module.exports = {
resolve: {
fallback: pathToModules
},
resolveLoader: {
fallback: pathToModules
},
entry: {
"show-list" : "./jsx/show-list/app"
},
output: { path: "./js/dist", filename: "[name].bundle.js" },
externals: {
"jquery": "jQuery",
},
module: {
loaders: [
{
test: /.js?$/,
loader: "babel-loader",
query: {
presets: ["es2015", "react"]
}
}
]
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment