Skip to content

Instantly share code, notes, and snippets.

@mihir0x69
Created July 1, 2016 07:31
Show Gist options
  • Save mihir0x69/4b2f6b84dd18749be3b0137f3f2bfb44 to your computer and use it in GitHub Desktop.
Save mihir0x69/4b2f6b84dd18749be3b0137f3f2bfb44 to your computer and use it in GitHub Desktop.
var path = require('path')
var webpack = require('webpack')
module.exports = {
devtool: 'cheap-module-eval-source-map',
entry: [
'script!jquery/dist/jquery.min.js',
'webpack-hot-middleware/client',
'./index'
],
externals: {
jquery: 'jQuery'
},
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/'
},
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
}),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin()
],
module: {
loaders: [
{
test: /\.js$/,
loaders: [ 'babel' ],
exclude: /node_modules/,
include: __dirname
},
{
test: /\.css?$/,
loaders: [ 'style', 'raw'],
include: __dirname
},
{
test: /\.json$/,
loaders: [ 'json' ],
exclude: /node_modules/,
include: __dirname
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment