Clean build folder
Former-commit-id: e47639684bbb1b4d0a15ac8c39dbb0040ae86226 [formerly 3343000db072beb88cec31bb52b139313469f612] [formerly 062dd709613b5784dc8e9b2f327df3cd4c95dc75 [formerly 69d8cd63433f1a56a258a0fb604355a66fe3d20e]] Former-commit-id: 1c0ebd340266b2020ffba94d2370dbf7c98d1aa6 [formerly fcf840509a0f782b8460fb354aed513dbaa10aa2] Former-commit-id: bd4e275034627c7ff9c8b60c1405ce6aed912761
This commit is contained in:
@@ -23,7 +23,7 @@ var webpackConfig = merge(baseWebpackConfig, {
|
||||
},
|
||||
devtool: config.build.productionSourceMap ? '#source-map' : false,
|
||||
output: {
|
||||
path: config.build.assetsRoot,
|
||||
path: config.assetsRoot,
|
||||
filename: utils.assetsPath('js/[name].[chunkhash].js'),
|
||||
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
|
||||
},
|
||||
@@ -31,12 +31,12 @@ var webpackConfig = merge(baseWebpackConfig, {
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
from: path.resolve(__dirname, '../static'),
|
||||
to: config.dev.assetsSubDirectory,
|
||||
to: config.assetsSubDirectory,
|
||||
ignore: ['.*']
|
||||
},
|
||||
{
|
||||
from: path.resolve(__dirname, '../node_modules/codemirror/mode/*/*'),
|
||||
to: path.join(config.build.assetsSubDirectory, 'js/codemirror/mode/[name]/[name].js'),
|
||||
to: path.join(config.assetsSubDirectory, 'js/codemirror/mode/[name]/[name].js'),
|
||||
transform: function (source, path) {
|
||||
let result = UglifyJS.minify(source.toString('utf8'))
|
||||
if (result.error !== undefined) {
|
||||
@@ -71,7 +71,7 @@ var webpackConfig = merge(baseWebpackConfig, {
|
||||
// you can customize output by editing /index.html
|
||||
// see https://github.com/ampedandwired/html-webpack-plugin
|
||||
new HtmlWebpackPlugin({
|
||||
filename: config.build.index,
|
||||
filename: config.index,
|
||||
template: 'assets/index.html',
|
||||
inject: true,
|
||||
minify: {
|
||||
@@ -119,24 +119,6 @@ var webpackConfig = merge(baseWebpackConfig, {
|
||||
]
|
||||
})
|
||||
|
||||
if (config.build.productionGzip) {
|
||||
var CompressionWebpackPlugin = require('compression-webpack-plugin')
|
||||
|
||||
webpackConfig.plugins.push(
|
||||
new CompressionWebpackPlugin({
|
||||
asset: '[path].gz[query]',
|
||||
algorithm: 'gzip',
|
||||
test: new RegExp(
|
||||
'\\.(' +
|
||||
config.build.productionGzipExtensions.join('|') +
|
||||
')$'
|
||||
),
|
||||
threshold: 10240,
|
||||
minRatio: 0.8
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
if (config.build.bundleAnalyzerReport) {
|
||||
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
|
||||
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
|
||||
|
||||
Reference in New Issue
Block a user