Created
November 9, 2018 14:34
-
-
Save Omar-Gonzalez/6830004c0ec54b4f76a3d4b026fd4059 to your computer and use it in GitHub Desktop.
react-django-webpack config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const webpack = require('webpack'); | |
const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); | |
module.exports = { | |
entry:[ | |
'./app.jsx' | |
], | |
output:{ | |
filename:'../pecsa.bundle.js' | |
}, | |
module:{ | |
loaders:[ | |
{ | |
test:/\.js[x]?$/, | |
loader:'babel-loader', | |
exclude:/(node_modules)/, | |
query:{ | |
presets:['es2015','react'] | |
} | |
} | |
] | |
}, | |
plugins: [ | |
//Minify build | |
new UglifyJsPlugin(), | |
//build production | |
new webpack.DefinePlugin({ | |
'process.env.NODE_ENV': JSON.stringify('production') | |
}), | |
//expose jquery window global | |
new webpack.ProvidePlugin({ | |
$: 'jquery', | |
jQuery: 'jquery', | |
'window.jQuery': 'jquery', | |
tether: 'tether', | |
Tether: 'tether', | |
'window.Tether': 'tether', | |
}) | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment