You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.4 KiB

const webpack = require('webpack');
const BundleTracker = require('webpack-bundle-tracker');
9 years ago
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const config = require('./webpack.base.config.js');
9 years ago
// Use webpack dev server
config.entry = {
webpack: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
],
signin: './assets/js/index',
members: './assets/js/members/index',
bikes: './assets/js/bikes/index',
};
9 years ago
// override django's STATIC_URL for webpack bundles
config.output.publicPath = 'http://localhost:3000/assets/bundles/';
9 years ago
config.devtool = 'eval-source-map';
9 years ago
// Add HotModuleReplacementPlugin and BundleTracker plugins
config.plugins = config.plugins.concat([
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new BundleTracker({ filename: './webpack-stats.json' }),
new ExtractTextPlugin('react-toolbox.css', { allChunks: true }),
]);
9 years ago
// Add a loader for JSX files
9 years ago
config.module.loaders.push(
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['latest', 'react', 'stage-3'],
plugins: ['transform-runtime'],
},
},
{
test: /(\.scss|\.css)$/,
loader: ExtractTextPlugin.extract('style', 'css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!sass?sourceMap!toolbox'),
},
{
test: /\.json$/,
loader: 'json-loader',
}
);
module.exports = config;