2017-10-29 03:14:14 +01:00
|
|
|
const merge = require('webpack-merge');
|
2017-10-29 03:47:01 +01:00
|
|
|
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
2017-11-09 20:28:18 +01:00
|
|
|
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
|
2017-10-29 03:14:14 +01:00
|
|
|
const common = require('./webpack.common.js');
|
2017-11-09 17:59:41 +01:00
|
|
|
const webpack = require('webpack');
|
|
|
|
|
|
|
|
const extractLess = new ExtractTextPlugin({
|
|
|
|
filename: 'popup/css/[name].css',
|
|
|
|
disable: false,
|
|
|
|
allChunks: true
|
|
|
|
});
|
2017-10-29 03:14:14 +01:00
|
|
|
|
|
|
|
module.exports = merge(common, {
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.less$/,
|
|
|
|
use: extractLess.extract({
|
|
|
|
use: [
|
|
|
|
{
|
2017-10-29 03:47:01 +01:00
|
|
|
loader: 'css-loader',
|
2017-10-29 03:14:14 +01:00
|
|
|
},
|
|
|
|
{
|
2017-10-29 03:47:01 +01:00
|
|
|
loader: 'less-loader',
|
2017-10-29 03:14:14 +01:00
|
|
|
}
|
|
|
|
]
|
|
|
|
})
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
plugins: [
|
2017-11-09 20:28:18 +01:00
|
|
|
new UglifyJSPlugin({
|
|
|
|
include: ['vendor.js', 'popup/vendor.js']
|
|
|
|
}),
|
2017-11-08 16:22:26 +01:00
|
|
|
new webpack.SourceMapDevToolPlugin({
|
|
|
|
filename: '[name].js.map',
|
2017-11-09 17:59:41 +01:00
|
|
|
include: ['background.js', 'popup/app.js']
|
2017-11-08 16:22:26 +01:00
|
|
|
}),
|
2017-11-09 17:59:41 +01:00
|
|
|
extractLess
|
2017-10-29 03:14:14 +01:00
|
|
|
]
|
|
|
|
});
|