Skip to content

Commit

Permalink
chore(deps): update (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi authored Sep 14, 2020
1 parent 17303be commit bbfa283
Show file tree
Hide file tree
Showing 12 changed files with 438 additions and 317 deletions.
249 changes: 200 additions & 49 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
"jest-worker": "^26.3.0",
"p-limit": "^3.0.2",
"schema-utils": "^2.7.1",
"serialize-javascript": "^4.0.0",
"serialize-javascript": "^5.0.1",
"source-map": "^0.6.1",
"terser": "^5.3.0",
"terser": "^5.3.1",
"webpack-sources": "^1.4.3"
},
"devDependencies": {
Expand All @@ -64,7 +64,7 @@
"cross-env": "^7.0.2",
"del": "^5.1.0",
"del-cli": "^3.0.1",
"eslint": "^7.8.1",
"eslint": "^7.9.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.21.2",
"file-loader": "^6.1.0",
Expand Down
30 changes: 15 additions & 15 deletions test/__snapshots__/TerserPlugin.test.js.snap.webpack4

Large diffs are not rendered by default.

52 changes: 26 additions & 26 deletions test/__snapshots__/TerserPlugin.test.js.snap.webpack5

Large diffs are not rendered by default.

72 changes: 36 additions & 36 deletions test/__snapshots__/extractComments-option.test.js.snap.webpack4

Large diffs are not rendered by default.

78 changes: 52 additions & 26 deletions test/__snapshots__/extractComments-option.test.js.snap.webpack5

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/__snapshots__/minify-option.test.js.snap.webpack4
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`minify option should snapshot with extracting comments: assets 1`] = `
Object {
"main.js": "/*! For license information please see main.js.LICENSE.txt */
!function(n){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=n,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&\\"object\\"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:t}),2&e&&\\"string\\"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,\\"a\\",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p=\\"\\",o(o.s=0)}([function(e,t){e.exports=function(){var baz=document.getElementById(\\"root\\").innerHTML;document.getElementById(\\"demo\\").innerHTML=\\"Paragraph changed.\\"+baz}}]);",
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\\"a\\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\\"\\",n(n.s=0)}([function(e,t){e.exports=function(){var baz=document.getElementById(\\"root\\").innerHTML;document.getElementById(\\"demo\\").innerHTML=\\"Paragraph changed.\\"+baz}}]);",
"main.js.LICENSE.txt": "/* Foo */
",
}
Expand Down
2 changes: 1 addition & 1 deletion test/__snapshots__/minify-option.test.js.snap.webpack5
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`minify option should snapshot with extracting comments: assets 1`] = `
Object {
"main.js": "/*! For license information please see main.js.LICENSE.txt */
!function(){var r={293:function(e){e.exports=function(){var baz=document.getElementById(\\"root\\").innerHTML;document.getElementById(\\"demo\\").innerHTML=\\"Paragraph changed.\\"+baz}}},o={};!function e(n){if(o[n])return o[n].exports;var t=o[n]={exports:{}};return r[n](t,t.exports,e),t.exports}(293)}();",
(()=>{var e={293:e=>{e.exports=function(){var baz=document.getElementById(\\"root\\").innerHTML;document.getElementById(\\"demo\\").innerHTML=\\"Paragraph changed.\\"+baz}}},r={};!function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{}};return e[n](o,o.exports,t),o.exports}(293)})();",
"main.js.LICENSE.txt": "/* Foo */
",
}
Expand Down
86 changes: 46 additions & 40 deletions test/__snapshots__/test-option.test.js.snap.webpack4

Large diffs are not rendered by default.

160 changes: 48 additions & 112 deletions test/__snapshots__/test-option.test.js.snap.webpack5

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions test/fixtures/entry.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
// foo
/* @preserve*/
// bar
const a = 2 + 2;

module.exports = function Foo() {
function test() {
const b = 2 + 2;
console.log(b + 1 + 2);
};
console.log(b + 1 + 2 + a);
}

test();

module.exports = test;
7 changes: 3 additions & 4 deletions test/minify-option.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ describe('minify option', () => {
const compiler = getCompiler({
entry: path.resolve(__dirname, './fixtures/minify/es5.js'),
output: {
...(getCompiler.isWebpack4() ? {} : { ecmaVersion: 5 }),
path: path.resolve(__dirname, './dist-uglify-js'),
filename: '[name].js',
chunkFilename: '[id].[name].js',
Expand All @@ -177,9 +176,9 @@ describe('minify option', () => {

new TerserPlugin({
extractComments: true,
minify(file) {
async minify(file) {
// eslint-disable-next-line global-require
const result = require('uglify-js').minify(file, {
const result = await require('terser').minify(file, {
mangle: {
reserved: ['baz'],
},
Expand Down Expand Up @@ -236,9 +235,9 @@ describe('minify option', () => {

it('should work with "uglify-js" minimizer', async () => {
const compiler = getCompiler({
...(getCompiler.isWebpack4() ? {} : { target: ['es5', 'web'] }),
entry: path.resolve(__dirname, './fixtures/minify/es5.js'),
output: {
...(getCompiler.isWebpack4() ? {} : { ecmaVersion: 5 }),
path: path.resolve(__dirname, './dist-uglify-js'),
filename: '[name].js',
chunkFilename: '[id].[name].js',
Expand Down

0 comments on commit bbfa283

Please sign in to comment.