mirror of
https://github.com/ustc-zzzz/mcbbs-markdown2bbcode-converter.git
synced 2024-11-27 02:49:58 +08:00
34 lines
856 B
JavaScript
34 lines
856 B
JavaScript
var path = require('path')
|
|
|
|
var DefinePlugin = require('webpack').DefinePlugin
|
|
var HtmlWebpackPlugin = require('html-webpack-plugin')
|
|
var UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
|
|
|
module.exports = {
|
|
entry: './src/index.js',
|
|
output: {
|
|
path: path.join(__dirname, './build'),
|
|
filename: 'index.js'
|
|
},
|
|
module: {
|
|
loaders: [{
|
|
test: /\.js$/,
|
|
loader: 'babel-loader?presets[]=react&presets[]=stage-2'
|
|
}, {
|
|
test: /\.css$/,
|
|
loader: 'style-loader!css-loader'
|
|
}, {
|
|
test: /\.woff2$/,
|
|
loader: 'url-loader?limit=65535'
|
|
}]
|
|
},
|
|
plugins: [new HtmlWebpackPlugin({
|
|
template: './src/index.html',
|
|
minify: {collapseWhitespace: true}
|
|
}), new DefinePlugin({
|
|
'process.env.NODE_ENV': JSON.stringify('production')
|
|
}), new UglifyJsPlugin({
|
|
uglifyOptions: {ie8: false, ecma: 6}
|
|
})]
|
|
}
|