Skip to content

Commit

Permalink
chore(deps): update (#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait authored Mar 4, 2021
1 parent ee1d938 commit bfbb68a
Show file tree
Hide file tree
Showing 13 changed files with 19,482 additions and 3,692 deletions.
21,773 changes: 18,725 additions & 3,048 deletions package-lock.json

Large diffs are not rendered by default.

34 changes: 16 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
"pretest": "npm run lint",
"test": "npm run test:coverage",
"prepare": "npm run build",
"release": "standard-version",
"defaults": "webpack-defaults"
"release": "standard-version"
},
"files": [
"dist",
Expand All @@ -50,37 +49,36 @@
"schema-utils": "^3.0.0",
"serialize-javascript": "^5.0.1",
"source-map": "^0.6.1",
"terser": "^5.5.1"
"terser": "^5.6.0"
},
"devDependencies": {
"@babel/cli": "^7.12.10",
"@babel/core": "^7.12.10",
"@babel/preset-env": "^7.12.11",
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@babel/cli": "^7.13.0",
"@babel/core": "^7.13.8",
"@babel/preset-env": "^7.13.9",
"@commitlint/cli": "^12.0.1",
"@commitlint/config-conventional": "^12.0.1",
"@types/serialize-javascript": "^5.0.0",
"@webpack-contrib/defaults": "^6.3.0",
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
"babel-jest": "^26.6.3",
"copy-webpack-plugin": "^7.0.0",
"copy-webpack-plugin": "^8.0.0",
"cross-env": "^7.0.3",
"del": "^6.0.0",
"del-cli": "^3.0.1",
"eslint": "^7.18.0",
"eslint-config-prettier": "^7.2.0",
"eslint": "^7.21.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-import": "^2.22.1",
"file-loader": "^6.2.0",
"husky": "^4.3.8",
"jest": "^26.6.3",
"lint-staged": "^10.5.3",
"lint-staged": "^10.5.4",
"memfs": "^3.2.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.2.1",
"standard-version": "^9.1.0",
"typescript": "^4.1.3",
"uglify-js": "^3.12.5",
"webpack": "^5.16.0",
"worker-loader": "^3.0.7"
"standard-version": "^9.1.1",
"typescript": "^4.2.2",
"uglify-js": "^3.13.0",
"webpack": "^5.24.3",
"worker-loader": "^3.0.8"
},
"keywords": [
"uglify",
Expand Down
28 changes: 21 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@ import { minify as minifyFn } from "./minify";
/** @typedef {import("source-map").RawSourceMap} RawSourceMap */
/** @typedef {import("./minify.js").InternalMinifyOptions} InternalMinifyOptions */
/** @typedef {import("./minify.js").InternalMinifyResult} InternalMinifyResult */
/** @typedef {import("./minify.js").CustomMinifyOptions} CustomMinifyOptions */

/** @typedef {RegExp | string} Rule */

/** @typedef {Rule[] | Rule} Rules */

/** @typedef {JestWorker & { transform: (options: string) => InternalMinifyResult, minify: (options: InternalMinifyOptions) => InternalMinifyResult }} MinifyWorker */

/** @typedef {Object.<any, any> | TerserMinifyOptions} MinifyOptions */

/**
* @callback ExtractCommentsFunction
* @param {any} astNode
Expand Down Expand Up @@ -59,26 +58,41 @@ import { minify as minifyFn } from "./minify";

/**
* @callback CustomMinifyFunction
* @param {Object.<string, string>} file
* @param {RawSourceMap | undefined} sourceMap
* @param {MinifyOptions} minifyOptions
* @param {{ [file: string]: string }} fileAndCode
* @param {RawSourceMap} [sourceMap]
* @param {Object.<any, any>} minifyOptions
*/

/**
* @typedef {ExtractCommentsCondition | ExtractCommentsObject} ExtractCommentsOptions
*/

/**
* @typedef {Object} TerserPluginOptions
* @typedef {Object} PluginWithTerserOptions
* @property {Rules} [test]
* @property {Rules} [include]
* @property {Rules} [exclude]
* @property {MinifyOptions} [terserOptions]
* @property {TerserMinifyOptions} [terserOptions]
* @property {ExtractCommentsOptions} [extractComments]
* @property {boolean} [parallel]
* @property {CustomMinifyFunction} [minify]
*/

/**
* @typedef {Object} PluginWithCustomMinifyOptions
* @property {Rules} [test]
* @property {Rules} [include]
* @property {Rules} [exclude]
* @property {Object.<any, any>} [terserOptions]
* @property {ExtractCommentsOptions} [extractComments]
* @property {boolean} [parallel]
* @property {CustomMinifyFunction} [minify]
*/

/**
* @typedef {PluginWithTerserOptions | PluginWithCustomMinifyOptions} TerserPluginOptions
*/

class TerserPlugin {
/**
* @param {TerserPluginOptions} options
Expand Down
11 changes: 7 additions & 4 deletions src/minify.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@ const { minify: terserMinify } = require("terser");
/** @typedef {import("source-map").RawSourceMap} RawSourceMap */
/** @typedef {import("./index.js").ExtractCommentsOptions} ExtractCommentsOptions */
/** @typedef {import("./index.js").CustomMinifyFunction} CustomMinifyFunction */
/** @typedef {import("./index.js").MinifyOptions} MinifyOptions */
/** @typedef {import("terser").MinifyOptions} TerserMinifyOptions */
/** @typedef {import("terser").MinifyOutput} MinifyOutput */
/** @typedef {import("terser").FormatOptions} FormatOptions */
/** @typedef {import("terser").MangleOptions} MangleOptions */
/** @typedef {import("./index.js").ExtractCommentsFunction} ExtractCommentsFunction */
/** @typedef {import("./index.js").ExtractCommentsCondition} ExtractCommentsCondition */

/**
* @typedef {Object.<any, any>} CustomMinifyOptions
*/

/**
* @typedef {Object} InternalMinifyOptions
* @property {string} name
* @property {string} input
* @property {RawSourceMap | undefined} inputSourceMap
* @property {RawSourceMap} [inputSourceMap]
* @property {ExtractCommentsOptions} extractComments
* @property {CustomMinifyFunction | undefined} minify
* @property {MinifyOptions} minifyOptions
* @property {CustomMinifyFunction} [minify]
* @property {TerserMinifyOptions | CustomMinifyOptions} minifyOptions
*/

/**
Expand Down
Loading

0 comments on commit bfbb68a

Please sign in to comment.