ant-design/webpack.config.js
2016-02-03 11:40:18 +08:00

65 lines
1.3 KiB
JavaScript

var webpack = require('webpack');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var path = require('path');
var pkg = require('./package');
var entry = {};
entry['demo'] = './scripts/demo.js';
module.exports = {
entry: entry,
cache: true,
resolve: {
extensions: ['', '.js', '.jsx'],
unsafeCache: true
},
noParse: /_site|node_modules/,
output: {
path: path.join(process.cwd(), 'dist'),
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'],
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'
)
}]
},
plugins: [
new ExtractTextPlugin('[name].css')
],
devtool: 'source-map'
};