Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var path = require("path")
- var webpack = require('webpack')
- var BundleTracker = require('webpack-bundle-tracker')
- module.exports = {
- context: __dirname,
- entry: [
- 'react-hot-loader/patch',
- 'webpack-dev-server/client?http://localhost:3000',
- 'webpack/hot/only-dev-server',
- './apps/static/js/index'
- ],
- output: {
- path: path.resolve('./apps/static/bundles/'),
- filename: '[name]-[hash].js',
- publicPath: 'http://localhost:3000/static/bundles/', // Tell django to use this URL to load packages and not use STATIC_URL + bundle_name
- },
- plugins: [
- new webpack.HotModuleReplacementPlugin(),
- new webpack.NoErrorsPlugin(), // don't reload if there is an error
- new BundleTracker({filename: './webpack-stats.json'}),
- ],
- module: {
- loaders: [
- // we pass the output from babel loader to react-hot loader
- { test: /\.jsx?$/, exclude: /node_modules/, loaders: ['react-hot', 'babel'], },
- ],
- },
- resolve: {
- modulesDirectories: ['node_modules', 'bower_components'],
- extensions: ['', '.js', '.jsx']
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement