Skip to content

Instantly share code, notes, and snippets.

@jacek-dargiel
Created April 2, 2015 11:37
Show Gist options
  • Select an option

  • Save jacek-dargiel/08704ce7a3b2b4966f9d to your computer and use it in GitHub Desktop.

Select an option

Save jacek-dargiel/08704ce7a3b2b4966f9d to your computer and use it in GitHub Desktop.
Webpack imporst loader
var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: {
codebase: './js/codebase.js'
},
output: {
filename: '[name].js'
},
resolve: {
root: [path.join(__dirname, 'bower_components')]
},
plugins: [
new webpack.ResolverPlugin(
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin('bower.json', ['main'])
),
new webpack.ProvidePlugin({
'$': 'jquery',
'jQuery': 'jquery',
'window.jQuery': 'jquery'
})
],
module: {
loaders: [
{
test: /jBox\.js$/,
loader: 'imports?jQuery=jquery'
}
]
},
devtool: '#source-map',
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment