-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update dependencies - Switch from extract-text to mini-css-extract
- Loading branch information
pqml
committed
Oct 9, 2018
1 parent
6fd0ad4
commit 1e4ea21
Showing
12 changed files
with
84 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"env", | ||
"@babel/preset-env", | ||
{ | ||
"targets": { | ||
"browsers": ["last 2 versions", "ie >= 11"] | ||
}, | ||
"targets": "> 0.5%, last 2 versions, Firefox ESR, ie >= 10, not dead", | ||
"modules": false | ||
} | ||
] | ||
], | ||
"plugins": ["transform-runtime"] | ||
"plugins": ["@babel/plugin-transform-runtime"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
8 | ||
v8.12.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,52 @@ | ||
const path = require('path') | ||
const webpack = require('webpack') | ||
const merge = require('webpack-merge') | ||
const ExtractTextPlugin = require('extract-text-webpack-plugin') | ||
|
||
const MiniCssExtractPlugin = require('mini-css-extract-plugin') | ||
const UglifyPlugin = require('uglifyjs-webpack-plugin') | ||
|
||
const common = require('./webpack.config.common') | ||
const user = require('./scripts/utils/format-config')(require('./main.config.js')) | ||
|
||
const prodConfig = { | ||
mode: 'production', | ||
entry: user.entries, | ||
devtool: 'source-map', | ||
module: { | ||
rules: [ | ||
{ | ||
test: user.css.sourceRegexExt, | ||
use: ExtractTextPlugin.extract({ | ||
fallback: 'style-loader', | ||
use: common.CSSLoaders | ||
}) | ||
use: [MiniCssExtractPlugin.loader].concat(common.CSSLoaders) | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
new webpack.optimize.ModuleConcatenationPlugin(), | ||
|
||
new MiniCssExtractPlugin({ | ||
filename: '[name].css' | ||
}) | ||
], | ||
optimization: { | ||
minimizer: [ | ||
new UglifyPlugin({ | ||
sourceMap: true, | ||
parallel: true, | ||
uglifyOptions: { | ||
mangle: true, | ||
keep_classnames: true, | ||
keep_fnames: false, | ||
compress: { inline: false, drop_console: true }, | ||
output: { comments: false } | ||
} | ||
}) | ||
], | ||
// Extract all css into one file | ||
new ExtractTextPlugin({ | ||
filename: (getPath) => { | ||
const ext = path.extname(getPath('[name]')) | ||
// If you import css from js entry files, these lines avoid to | ||
// override the js files with the extract-text-plugin output. | ||
// Instead, replace the bundle filepath extension by .css | ||
return (ext === '.css') | ||
? getPath('[name]') | ||
: getPath('[name]').slice(0, -ext.length) + '.css' | ||
}, | ||
allChunks: true | ||
}), | ||
|
||
// Minification and size optimization | ||
new UglifyPlugin({ | ||
sourceMap: true, | ||
parallel: true, | ||
uglifyOptions: { | ||
mangle: true, | ||
keep_classnames: true, | ||
keep_fnames: false, | ||
compress: { inline: false, drop_console: true }, | ||
output: { comments: false } | ||
splitChunks: { | ||
cacheGroups: { | ||
styles: { | ||
name: 'styles', | ||
test: /\.css$/, | ||
chunks: 'all', | ||
enforce: true | ||
} | ||
} | ||
}), | ||
|
||
new webpack.optimize.OccurrenceOrderPlugin() | ||
], | ||
devtool: '#source-map' | ||
} | ||
} | ||
} | ||
|
||
module.exports = merge(common.webpack, prodConfig) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters