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.

72 lines
1.6 KiB

var webpack = require('webpack');
10 years ago
var ExtractTextPlugin = require("extract-text-webpack-plugin");
10 years ago
var path = require('path');
10 years ago
var pkg = require('./package');
9 years ago
var autoprefixer = require('autoprefixer');
10 years ago
var entry = {};
entry['demo'] = ['./scripts/demo.js', 'webpack-hot-middleware/client'];
module.exports = {
10 years ago
entry: entry,
cache: true,
resolve: {
9 years ago
extensions: ['', '.js', '.jsx'],
unsafeCache: true
},
noParse: /_site|node_modules/,
output: {
10 years ago
path: path.join(process.cwd(), 'dist'),
publicPath: '/dist/',
9 years ago
filename: '[name].js'
},
module: {
loaders: [{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'es3ify'
}, {
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel',
query: {
cacheDirectory: true,
presets: ['es2015', 'react', 'stage-0', 'react-hmre'],
plugins: ['add-module-exports']
}
}, {
test: /\.json$/,
exclude: /node_modules/,
loader: 'json-loader'
}, {
test: /\.less$/,
exclude: /node_modules/,
loader: ExtractTextPlugin.extract(
'css?sourceMap&-minimize!' + 'postcss-loader!' + 'less?sourceMap'
)
}, {
test: /\.css$/,
exclude: /node_modules/,
loader: ExtractTextPlugin.extract(
'css?sourceMap&-minimize!' + 'postcss-loader'
)
}]
},
9 years ago
postcss: [autoprefixer],
10 years ago
plugins: [
new ExtractTextPlugin('[name].css'),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
],
9 years ago
devtool: 'cheap-module-source-map'
};