react-toolbox/webpack.config.development.js

46 lines
1.3 KiB
JavaScript
Raw Normal View History

const pkg = require('./package');
const path = require('path');
const webpack = require('webpack');
const autoprefixer = require('autoprefixer');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
context: __dirname,
2016-05-15 14:23:55 +03:00
devtool: 'inline-source-map',
entry: [
2015-10-29 08:33:21 +03:00
'webpack-hot-middleware/client',
2016-04-10 22:04:49 +03:00
'./spec/index.js'
],
output: {
path: path.join(__dirname, 'build'),
filename: 'spec.js',
publicPath: '/build/'
},
resolve: {
2016-04-10 22:04:49 +03:00
extensions: ['', '.scss', '.js', '.json'],
2016-04-09 21:34:34 +03:00
packageMains: ['browser', 'web', 'browserify', 'main', 'style']
},
module: {
loaders: [
{
2016-04-10 22:04:49 +03:00
test: /\.js$/,
2016-01-06 14:56:30 +03:00
loader: 'babel',
2016-05-15 14:23:55 +03:00
exclude: [/(node_modules)/, /react-css-themr/]
}, {
test: /\.(scss|css)$/,
2015-10-30 06:51:29 +03:00
loader: ExtractTextPlugin.extract('style', 'css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!sass?sourceMap')
}
]
},
postcss: [autoprefixer],
plugins: [
new ExtractTextPlugin('spec.css', { allChunks: true }),
new webpack.HotModuleReplacementPlugin(),
2015-10-29 08:33:21 +03:00
new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development'),
VERSION: JSON.stringify(pkg.version)
})
]
};