Skip to content
Snippets Groups Projects
webpack.dev.config.js 746 B
Newer Older
Todd Dembrey's avatar
Todd Dembrey committed
var path = require("path")
var webpack = require('webpack')
var BundleTracker = require('webpack-bundle-tracker')

Todd Dembrey's avatar
Todd Dembrey committed
var config = require('./webpack.base.config')
Todd Dembrey's avatar
Todd Dembrey committed

// 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(),
Todd Dembrey's avatar
Todd Dembrey committed
    new BundleTracker({filename: './opentech/static_compiled/app/webpack-stats.json'}),
Todd Dembrey's avatar
Todd Dembrey committed
])

// Add a loader for JSX files with react-hot enabled

config.devServer = {
Todd Dembrey's avatar
Todd Dembrey committed
    hotOnly: true,
Todd Dembrey's avatar
Todd Dembrey committed
    port: 3000
config.devtool = 'source-map'

Todd Dembrey's avatar
Todd Dembrey committed
config.mode = "development"

module.exports = config