mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 05:05:48 +08:00
69 lines
1.4 KiB
JavaScript
69 lines
1.4 KiB
JavaScript
var webpack = require('webpack');
|
|
var ExtractTextPlugin = require("extract-text-webpack-plugin");
|
|
var path = require('path');
|
|
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 = {
|
|
entry: entry,
|
|
|
|
resolve: {
|
|
extensions: ['', '.js', '.jsx']
|
|
},
|
|
|
|
output: {
|
|
path: path.join(process.cwd(), 'dist'),
|
|
filename: '[name].js',
|
|
library: 'antd',
|
|
libraryTarget: 'umd'
|
|
},
|
|
|
|
externals: {
|
|
'react': {
|
|
root: 'React',
|
|
commonjs2: 'react',
|
|
commonjs: 'react',
|
|
amd: 'react'
|
|
},
|
|
'antd':'antd',
|
|
'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(
|
|
'css?sourceMap&-minimize!' + 'autoprefixer-loader!' + 'less?sourceMap'
|
|
)
|
|
}, {
|
|
test: /\.css$/,
|
|
loader: ExtractTextPlugin.extract(
|
|
'css?sourceMap&-minimize!' + 'autoprefixer-loader'
|
|
)
|
|
}]
|
|
},
|
|
|
|
plugins: [
|
|
new ExtractTextPlugin('[name].css'),
|
|
new webpack.IgnorePlugin(/xhr2/)
|
|
],
|
|
|
|
devtool: 'source-map'
|
|
};
|