Skip to content
Snippets Groups Projects
dev.config.js 832 B
Newer Older
  • Learn to ignore specific revisions
  • Todd Dembrey's avatar
    Todd Dembrey committed
    var path = require("path")
    var webpack = require('webpack')
    var BundleTracker = require('webpack-bundle-tracker')
    
    var config = require('./base.config.js')
    
    
    // override django's STATIC_URL for webpack bundles
    
    config.output.publicPath = 'http://localhost:3000/app/'
    
    Todd Dembrey's avatar
    Todd Dembrey committed
    
    // Add HotModuleReplacementPlugin and BundleTracker plugins
    config.plugins = config.plugins.concat([
        new webpack.HotModuleReplacementPlugin(),
        new webpack.NoEmitOnErrorsPlugin(),
        new BundleTracker({filename: './webpack-stats.json'}),
    ])
    
    // Add a loader for JSX files with react-hot enabled
    
    config.devServer = {
    
        contentBase: path.join(__dirname, '../../../../static_compiled/app'),
        disableHostCheck: true,
        hot: true,
        port: 3000,
        host: '0.0.0.0'
    
    config.devtool = 'source-map'
    
    
    Todd Dembrey's avatar
    Todd Dembrey committed
    config.mode = "development"
    
    module.exports = config