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.

69 lines
1.4 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');
var entry = {};
entry[pkg.name] = './index.js';
entry[pkg.name + '-' + pkg.version] = './index.js';
entry['demo'] = './scripts/demo.js';
module.exports = {
10 years ago
entry: entry,
resolve: {
10 years ago
extensions: ['', '.js', '.jsx']
},
output: {
10 years ago
path: path.join(process.cwd(), 'dist'),
9 years ago
filename: '[name].js',
library: 'antd',
libraryTarget: 'umd'
},
externals: {
9 years ago
'react': {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react'
},
9 years ago
'antd':'antd',
9 years ago
'jquery': {
root: 'jQuery',
commonjs2: 'jquery',
commonjs: 'jquery',
amd: 'jquery'
}
},
module: {
loaders: [{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel'
}, {
test: /\.json$/,
loader: 'json-loader'
}, {
test: /\.less$/,
loader: ExtractTextPlugin.extract(
10 years ago
'css?sourceMap&-minimize!' + 'autoprefixer-loader!' + 'less?sourceMap'
)
}, {
test: /\.css$/,
loader: ExtractTextPlugin.extract(
10 years ago
'css?sourceMap&-minimize!' + 'autoprefixer-loader'
)
}]
},
10 years ago
plugins: [
9 years ago
new ExtractTextPlugin('[name].css'),
new webpack.IgnorePlugin(/xhr2/)
],
devtool: 'source-map'
};