-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
explicitly check webpack version major, add plugin tests
- Loading branch information
Showing
7 changed files
with
44 additions
and
8 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -8,14 +8,15 @@ function run() { | |
exit 1 | ||
fi | ||
|
||
npm ci | ||
# npm ci | ||
|
||
test_webpack "Webpack3" "[email protected] webpack-cli@2" "webpack3.config.js" || failed=1 | ||
test_webpack "Webpack4" "[email protected] webpack-cli@3" "webpack4.config.js" || failed=1 | ||
test_webpack "Webpack5" "[email protected] webpack-cli@4" "webpack5.config.js" || failed=1 | ||
test_webpack "WebpackLatest" "webpack@latest webpack-cli@latest" "webpack.config.js" || failed=1 | ||
test_webpack "Webpack4+Plugins" "[email protected] webpack-cli@3 [email protected]" "webpack-terser.config.js" || failed=1 | ||
|
||
npm ci | ||
# npm ci | ||
|
||
if [[ "$failed" ]]; then | ||
echo "Some tests failed!" | ||
|
@@ -42,7 +43,7 @@ function test_webpack() { | |
fi | ||
|
||
# build | ||
output="$(node_modules/.bin/webpack --config "test/$config" 2>&1)" | ||
output="$(node_modules/.bin/webpack --config "test/$config" --bail --color 2>&1)" | ||
echo "$output" | ||
|
||
does_contain_deprecation=$(echo "$output" | grep -i "Warning" || echo '') | ||
|
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use strict'; | ||
|
||
const webpack = require('webpack'); | ||
const IgnoreEmitPlugin = require('../'); | ||
const TerserPlugin = require('terser-webpack-plugin'); | ||
|
||
module.exports = { | ||
bail: true, | ||
mode: 'production', | ||
entry: { | ||
app: './test/app.js' | ||
}, | ||
output: { | ||
publicPath: '', | ||
chunkFilename: `[name].js`, | ||
path: __dirname + '/tmp' | ||
}, | ||
plugins: [ | ||
new IgnoreEmitPlugin(/chunk\.js$/, {debug: true}), | ||
new webpack.SourceMapDevToolPlugin() | ||
], | ||
optimization: { | ||
minimize: true, | ||
minimizer: [new TerserPlugin()] | ||
} | ||
}; |