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.
55 lines
1.1 KiB
55 lines
1.1 KiB
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,
|
|
|
|
resolve: {
|
|
extensions: ['', '.js', '.jsx']
|
|
},
|
|
|
|
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: {
|
|
presets: ['es2015', 'react', 'stage-0'],
|
|
plugins: ['add-module-exports']
|
|
}
|
|
}, {
|
|
test: /\.json$/,
|
|
loader: 'json-loader'
|
|
}, {
|
|
test: /\.less$/,
|
|
loader: ExtractTextPlugin.extract(
|
|
'css?sourceMap&-minimize!' + 'postcss-loader!' + 'less?sourceMap'
|
|
)
|
|
}, {
|
|
test: /\.css$/,
|
|
loader: ExtractTextPlugin.extract(
|
|
'css?sourceMap&-minimize!' + 'postcss-loader'
|
|
)
|
|
}]
|
|
},
|
|
|
|
plugins: [
|
|
new ExtractTextPlugin('[name].css')
|
|
],
|
|
|
|
devtool: 'source-map'
|
|
};
|
|
|