aboutsummaryrefslogtreecommitdiff
path: root/build/webpack.prod.conf.js
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2019-07-28 13:30:29 +0300
committerHenry Jameson <me@hjkos.com>2019-07-28 13:30:29 +0300
commitb3aff9bbae77b2fd34b2267ce9196c0ebd3e4691 (patch)
tree1219e00b6bfe6784add1578a3bc986c1dbb5f34d /build/webpack.prod.conf.js
parent7f6f025792dcb3a10c94c8952d0312abd0b46989 (diff)
parent4827e4d972f8ee11e606693e24ae4ca21711c6b1 (diff)
Merge remote-tracking branch 'upstream/develop' into emoji-selector-update
* upstream/develop: (469 commits) Feature/add sticker picker guard more secure routes guard secure routes by redirecting to root closest can returns itself as well find inside status-content div only try to use the closest a tag as target Update es.json Also apply keyword filter to subjects Remove files I accidentally pushed in fix issues caused by merges in usersearch on @ Add user search at fix eslint warnings remove vue-popperjs fix moderation menu partially hidden by usercard boundary migrate popper css rewrite ModerationTools using v-tooltip make popover position for status action dropdow relative to parent node rewrite ExtraButtons using v-tooltip install v-tooltip i18n/Update pedantic Japanese translation ...
Diffstat (limited to 'build/webpack.prod.conf.js')
-rw-r--r--build/webpack.prod.conf.js50
1 files changed, 16 insertions, 34 deletions
diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js
index 9699f221..ed11ebad 100644
--- a/build/webpack.prod.conf.js
+++ b/build/webpack.prod.conf.js
@@ -4,7 +4,7 @@ var utils = require('./utils')
var webpack = require('webpack')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf')
-var ExtractTextPlugin = require('extract-text-webpack-plugin')
+var MiniCssExtractPlugin = require('mini-css-extract-plugin')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var env = process.env.NODE_ENV === 'testing'
? require('../config/test.env')
@@ -13,23 +13,23 @@ var env = process.env.NODE_ENV === 'testing'
let commitHash = require('child_process')
.execSync('git rev-parse --short HEAD')
.toString();
-console.log(commitHash)
var webpackConfig = merge(baseWebpackConfig, {
+ mode: 'production',
module: {
- loaders: utils.styleLoaders({ sourceMap: config.build.productionSourceMap, extract: true })
+ rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, extract: true })
},
devtool: config.build.productionSourceMap ? '#source-map' : false,
+ optimization: {
+ minimize: true,
+ splitChunks: {
+ chunks: 'all'
+ }
+ },
output: {
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash].js'),
- chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
- },
- vue: {
- loaders: utils.cssLoaders({
- sourceMap: config.build.productionSourceMap,
- extract: true
- })
+ chunkFilename: utils.assetsPath('js/[name].[chunkhash].js')
},
plugins: [
// http://vuejs.github.io/vue-loader/workflow/production.html
@@ -38,14 +38,10 @@ var webpackConfig = merge(baseWebpackConfig, {
'COMMIT_HASH': JSON.stringify(commitHash),
'DEV_OVERRIDES': JSON.stringify(undefined)
}),
- new webpack.optimize.UglifyJsPlugin({
- compress: {
- warnings: false
- }
- }),
- new webpack.optimize.OccurenceOrderPlugin(),
// extract css into its own file
- new ExtractTextPlugin(utils.assetsPath('css/[name].[contenthash].css')),
+ new MiniCssExtractPlugin({
+ filename: utils.assetsPath('css/[name].[contenthash].css')
+ }),
// generate dist index.html with correct asset hash for caching.
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
@@ -67,25 +63,11 @@ var webpackConfig = merge(baseWebpackConfig, {
chunksSortMode: 'dependency'
}),
// split vendor js into its own file
- new webpack.optimize.CommonsChunkPlugin({
- name: 'vendor',
- minChunks: function (module, count) {
- // any required modules inside node_modules are extracted to vendor
- return (
- module.resource &&
- /\.js$/.test(module.resource) &&
- module.resource.indexOf(
- path.join(__dirname, '../node_modules')
- ) === 0
- )
- }
- }),
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
- new webpack.optimize.CommonsChunkPlugin({
- name: 'manifest',
- chunks: ['vendor']
- })
+ // new webpack.optimize.SplitChunksPlugin({
+ // name: ['app', 'vendor']
+ // }),
]
})