Project files
This commit is contained in:
20
receipeServer/frontend_old/node_modules/terser-webpack-plugin/LICENSE
generated
vendored
Normal file
20
receipeServer/frontend_old/node_modules/terser-webpack-plugin/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
Copyright JS Foundation and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
742
receipeServer/frontend_old/node_modules/terser-webpack-plugin/README.md
generated
vendored
Normal file
742
receipeServer/frontend_old/node_modules/terser-webpack-plugin/README.md
generated
vendored
Normal file
@@ -0,0 +1,742 @@
|
||||
<div align="center">
|
||||
<a href="https://github.com/webpack/webpack">
|
||||
<img width="200" height="200" src="https://webpack.js.org/assets/icon-square-big.svg">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
[![npm][npm]][npm-url]
|
||||
[![node][node]][node-url]
|
||||
[![deps][deps]][deps-url]
|
||||
[![tests][tests]][tests-url]
|
||||
[![cover][cover]][cover-url]
|
||||
[![chat][chat]][chat-url]
|
||||
[![size][size]][size-url]
|
||||
|
||||
# terser-webpack-plugin
|
||||
|
||||
This plugin uses [terser](https://github.com/terser/terser) to minify/minimize your JavaScript.
|
||||
|
||||
## Getting Started
|
||||
|
||||
Webpack v5 comes with the latest `terser-webpack-plugin` out of the box. If you are using Webpack v5 or above and wish to customize the options, you will still need to install `terser-webpack-plugin`. Using Webpack v4, you have to install `terser-webpack-plugin` v4.
|
||||
|
||||
To begin, you'll need to install `terser-webpack-plugin`:
|
||||
|
||||
```console
|
||||
$ npm install terser-webpack-plugin --save-dev
|
||||
```
|
||||
|
||||
Then add the plugin to your `webpack` config. For example:
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
const TerserPlugin = require("terser-webpack-plugin");
|
||||
|
||||
module.exports = {
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [new TerserPlugin()],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
And run `webpack` via your preferred method.
|
||||
|
||||
## Note about source maps
|
||||
|
||||
**Works only with `source-map`, `inline-source-map`, `hidden-source-map` and `nosources-source-map` values for the [`devtool`](https://webpack.js.org/configuration/devtool/) option.**
|
||||
|
||||
Why?
|
||||
|
||||
- `eval` wraps modules in `eval("string")` and the minimizer does not handle strings.
|
||||
- `cheap` has not column information and minimizer generate only a single line, which leave only a single mapping.
|
||||
|
||||
Using supported `devtool` values enable source map generation.
|
||||
|
||||
## Options
|
||||
|
||||
| Name | Type | Default | Description |
|
||||
| :---------------------------------------: | :-----------------------------------------------------------------------------: | :----------------------------------------------------------: | :------------------------------------------------------------------------ |
|
||||
| **[`test`](#test)** | `String\|RegExp\|Array<String\|RegExp>` | `/\.m?js(\?.*)?$/i` | Test to match files against. |
|
||||
| **[`include`](#include)** | `String\|RegExp\|Array<String\|RegExp>` | `undefined` | Files to include. |
|
||||
| **[`exclude`](#exclude)** | `String\|RegExp\|Array<String\|RegExp>` | `undefined` | Files to exclude. |
|
||||
| **[`parallel`](#parallel)** | `Boolean\|Number` | `true` | Use multi-process parallel running to improve the build speed. |
|
||||
| **[`minify`](#minify)** | `Function` | `TerserPlugin.terserMinify` | Allows you to override default minify function. |
|
||||
| **[`terserOptions`](#terseroptions)** | `Object` | [`default`](https://github.com/terser/terser#minify-options) | Terser [minify options](https://github.com/terser/terser#minify-options). |
|
||||
| **[`extractComments`](#extractcomments)** | `Boolean\|String\|RegExp\|Function<(node, comment) -> Boolean\|Object>\|Object` | `true` | Whether comments shall be extracted to a separate file. |
|
||||
|
||||
### `test`
|
||||
|
||||
Type: `String|RegExp|Array<String|RegExp>`
|
||||
Default: `/\.m?js(\?.*)?$/i`
|
||||
|
||||
Test to match files against.
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
test: /\.js(\?.*)?$/i,
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### `include`
|
||||
|
||||
Type: `String|RegExp|Array<String|RegExp>`
|
||||
Default: `undefined`
|
||||
|
||||
Files to include.
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
include: /\/includes/,
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### `exclude`
|
||||
|
||||
Type: `String|RegExp|Array<String|RegExp>`
|
||||
Default: `undefined`
|
||||
|
||||
Files to exclude.
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
exclude: /\/excludes/,
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### `parallel`
|
||||
|
||||
Type: `Boolean|Number`
|
||||
Default: `true`
|
||||
|
||||
Use multi-process parallel running to improve the build speed.
|
||||
Default number of concurrent runs: `os.cpus().length - 1`.
|
||||
|
||||
> ℹ️ Parallelization can speedup your build significantly and is therefore **highly recommended**.
|
||||
|
||||
> ⚠️ If you use **Circle CI** or any other environment that doesn't provide real available count of CPUs then you need to setup explicitly number of CPUs to avoid `Error: Call retries were exceeded` (see [#143](https://github.com/webpack-contrib/terser-webpack-plugin/issues/143), [#202](https://github.com/webpack-contrib/terser-webpack-plugin/issues/202)).
|
||||
|
||||
#### `Boolean`
|
||||
|
||||
Enable/disable multi-process parallel running.
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
parallel: true,
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
#### `Number`
|
||||
|
||||
Enable multi-process parallel running and set number of concurrent runs.
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
parallel: 4,
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### `minify`
|
||||
|
||||
Type: `Function`
|
||||
Default: `TerserPlugin.terserMinify`
|
||||
|
||||
Allows you to override default minify function.
|
||||
By default plugin uses [terser](https://github.com/terser/terser) package.
|
||||
Useful for using and testing unpublished versions or forks.
|
||||
|
||||
> ⚠️ **Always use `require` inside `minify` function when `parallel` option enabled**.
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
// Can be async
|
||||
const minify = (input, sourceMap, minimizerOptions, extractsComments) => {
|
||||
// The `minimizerOptions` option contains option from the `terserOptions` option
|
||||
// You can use `minimizerOptions.myCustomOption`
|
||||
|
||||
// Custom logic for extract comments
|
||||
const { map, code } = require("uglify-module") // Or require('./path/to/uglify-module')
|
||||
.minify(input, {
|
||||
/* Your options for minification */
|
||||
});
|
||||
|
||||
return { map, code, warnings: [], errors: [], extractedComments: [] };
|
||||
};
|
||||
|
||||
// Used to regenerate `fullhash`/`chunkhash` between different implementation
|
||||
// Example: you fix a bug in custom minimizer/custom function, but unfortunately webpack doesn't know about it, so you will get the same fullhash/chunkhash
|
||||
// to avoid this you can provide version of your custom minimizer
|
||||
// You don't need if you use only `contenthash`
|
||||
minify.getMinimizerVersion = () => {
|
||||
let packageJson;
|
||||
|
||||
try {
|
||||
// eslint-disable-next-line global-require, import/no-extraneous-dependencies
|
||||
packageJson = require("uglify-module/package.json");
|
||||
} catch (error) {
|
||||
// Ignore
|
||||
}
|
||||
|
||||
return packageJson && packageJson.version;
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
terserOptions: {
|
||||
myCustomOption: true,
|
||||
},
|
||||
minify,
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### `terserOptions`
|
||||
|
||||
Type: `Object`
|
||||
Default: [default](https://github.com/terser/terser#minify-options)
|
||||
|
||||
Terser [options](https://github.com/terser/terser#minify-options).
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
terserOptions: {
|
||||
ecma: undefined,
|
||||
parse: {},
|
||||
compress: {},
|
||||
mangle: true, // Note `mangle.properties` is `false` by default.
|
||||
module: false,
|
||||
// Deprecated
|
||||
output: null,
|
||||
format: null,
|
||||
toplevel: false,
|
||||
nameCache: null,
|
||||
ie8: false,
|
||||
keep_classnames: undefined,
|
||||
keep_fnames: false,
|
||||
safari10: false,
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### `extractComments`
|
||||
|
||||
Type: `Boolean|String|RegExp|Function<(node, comment) -> Boolean|Object>|Object`
|
||||
Default: `true`
|
||||
|
||||
Whether comments shall be extracted to a separate file, (see [details](https://github.com/webpack/webpack/commit/71933e979e51c533b432658d5e37917f9e71595a)).
|
||||
By default extract only comments using `/^\**!|@preserve|@license|@cc_on/i` regexp condition and remove remaining comments.
|
||||
If the original file is named `foo.js`, then the comments will be stored to `foo.js.LICENSE.txt`.
|
||||
The `terserOptions.format.comments` option specifies whether the comment will be preserved, i.e. it is possible to preserve some comments (e.g. annotations) while extracting others or even preserving comments that have been extracted.
|
||||
|
||||
#### `Boolean`
|
||||
|
||||
Enable/disable extracting comments.
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
extractComments: true,
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
#### `String`
|
||||
|
||||
Extract `all` or `some` (use `/^\**!|@preserve|@license|@cc_on/i` RegExp) comments.
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
extractComments: "all",
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
#### `RegExp`
|
||||
|
||||
All comments that match the given expression will be extracted to the separate file.
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
extractComments: /@extract/i,
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
#### `Function<(node, comment) -> Boolean>`
|
||||
|
||||
All comments that match the given expression will be extracted to the separate file.
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
extractComments: (astNode, comment) => {
|
||||
if (/@extract/i.test(comment.value)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
#### `Object`
|
||||
|
||||
Allow to customize condition for extract comments, specify extracted file name and banner.
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
extractComments: {
|
||||
condition: /^\**!|@preserve|@license|@cc_on/i,
|
||||
filename: (fileData) => {
|
||||
// The "fileData" argument contains object with "filename", "basename", "query" and "hash"
|
||||
return `${fileData.filename}.LICENSE.txt${fileData.query}`;
|
||||
},
|
||||
banner: (licenseFile) => {
|
||||
return `License information can be found in ${licenseFile}`;
|
||||
},
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
##### `condition`
|
||||
|
||||
Type: `Boolean|String|RegExp|Function<(node, comment) -> Boolean|Object>`
|
||||
|
||||
Condition what comments you need extract.
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
extractComments: {
|
||||
condition: "some",
|
||||
filename: (fileData) => {
|
||||
// The "fileData" argument contains object with "filename", "basename", "query" and "hash"
|
||||
return `${fileData.filename}.LICENSE.txt${fileData.query}`;
|
||||
},
|
||||
banner: (licenseFile) => {
|
||||
return `License information can be found in ${licenseFile}`;
|
||||
},
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
##### `filename`
|
||||
|
||||
Type: `String|Function<(string) -> String>`
|
||||
Default: `[file].LICENSE.txt[query]`
|
||||
|
||||
Available placeholders: `[file]`, `[query]` and `[filebase]` (`[base]` for webpack 5).
|
||||
|
||||
The file where the extracted comments will be stored.
|
||||
Default is to append the suffix `.LICENSE.txt` to the original filename.
|
||||
|
||||
> ⚠️ We highly recommend using the `txt` extension. Using `js`/`cjs`/`mjs` extensions may conflict with existing assets which leads to broken code.
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
extractComments: {
|
||||
condition: /^\**!|@preserve|@license|@cc_on/i,
|
||||
filename: "extracted-comments.js",
|
||||
banner: (licenseFile) => {
|
||||
return `License information can be found in ${licenseFile}`;
|
||||
},
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
##### `banner`
|
||||
|
||||
Type: `Boolean|String|Function<(string) -> String>`
|
||||
Default: `/*! For license information please see ${commentsFile} */`
|
||||
|
||||
The banner text that points to the extracted file and will be added on top of the original file.
|
||||
Can be `false` (no banner), a `String`, or a `Function<(string) -> String>` that will be called with the filename where extracted comments have been stored.
|
||||
Will be wrapped into comment.
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
extractComments: {
|
||||
condition: true,
|
||||
filename: (fileData) => {
|
||||
// The "fileData" argument contains object with "filename", "basename", "query" and "hash"
|
||||
return `${fileData.filename}.LICENSE.txt${fileData.query}`;
|
||||
},
|
||||
banner: (commentsFile) => {
|
||||
return `My custom banner about license information ${commentsFile}`;
|
||||
},
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
### Preserve Comments
|
||||
|
||||
Extract all legal comments (i.e. `/^\**!|@preserve|@license|@cc_on/i`) and preserve `/@license/i` comments.
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
terserOptions: {
|
||||
format: {
|
||||
comments: /@license/i,
|
||||
},
|
||||
},
|
||||
extractComments: true,
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### Remove Comments
|
||||
|
||||
If you avoid building with comments, use this config:
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
terserOptions: {
|
||||
format: {
|
||||
comments: false,
|
||||
},
|
||||
},
|
||||
extractComments: false,
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### [`uglify-js`](https://github.com/mishoo/UglifyJS)
|
||||
|
||||
[`UglifyJS`](https://github.com/mishoo/UglifyJS) is a JavaScript parser, minifier, compressor and beautifier toolkit.
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
minify: TerserPlugin.uglifyJsMinify,
|
||||
// `terserOptions` options will be passed to `uglify-js`
|
||||
// Link to options - https://github.com/mishoo/UglifyJS#minify-options
|
||||
terserOptions: {},
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### [`swc`](https://github.com/swc-project/swc)
|
||||
|
||||
[`swc`](https://github.com/swc-project/swc) is a super-fast compiler written in rust; producing widely-supported javascript from modern standards and typescript.
|
||||
|
||||
> ⚠ the `extractComments` option is not supported and all comments will be removed by default, it will be fixed in future
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
minify: TerserPlugin.swcMinify,
|
||||
// `terserOptions` options will be passed to `swc` (`@swc/core`)
|
||||
// Link to options - https://swc.rs/docs/config-js-minify
|
||||
terserOptions: {},
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### [`esbuild`](https://github.com/evanw/esbuild)
|
||||
|
||||
[`esbuild`](https://github.com/evanw/esbuild) is an extremely fast JavaScript bundler and minifier.
|
||||
|
||||
> ⚠ the `extractComments` option is not supported and all legal comments (i.e. copyright, licenses and etc) will be preserved
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
minify: TerserPlugin.esbuildMinify,
|
||||
// `terserOptions` options will be passed to `esbuild`
|
||||
// Link to options - https://esbuild.github.io/api/#minify
|
||||
// Note: the `minify` options is true by default (and override other `minify*` options), so if you want to disable the `minifyIdentifiers` option (or other `minify*` options) please use:
|
||||
// terserOptions: {
|
||||
// minify: false,
|
||||
// minifyWhitespace: true,
|
||||
// minifyIdentifiers: false,
|
||||
// minifySyntax: true,
|
||||
// },
|
||||
terserOptions: {},
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### Custom Minify Function
|
||||
|
||||
Override default minify function - use `uglify-js` for minification.
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
minify: (file, sourceMap) => {
|
||||
// https://github.com/mishoo/UglifyJS2#minify-options
|
||||
const uglifyJsOptions = {
|
||||
/* your `uglify-js` package options */
|
||||
};
|
||||
|
||||
if (sourceMap) {
|
||||
uglifyJsOptions.sourceMap = {
|
||||
content: sourceMap,
|
||||
};
|
||||
}
|
||||
|
||||
return require("uglify-js").minify(file, uglifyJsOptions);
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### Typescript
|
||||
|
||||
With default terser minify function:
|
||||
|
||||
```ts
|
||||
module.exports = {
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
terserOptions: {
|
||||
compress: true,
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
With built-in minify functions:
|
||||
|
||||
```ts
|
||||
import type { JsMinifyOptions as SwcOptions } from "@swc/core";
|
||||
import type { MinifyOptions as UglifyJSOptions } from "uglify-js";
|
||||
import type { TransformOptions as EsbuildOptions } from "esbuild";
|
||||
import type { MinifyOptions as TerserOptions } from "terser";
|
||||
|
||||
module.exports = {
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin<SwcOptions>({
|
||||
minify: TerserPlugin.swcMinify,
|
||||
terserOptions: {
|
||||
// `swc` options
|
||||
},
|
||||
}),
|
||||
new TerserPlugin<UglifyJSOptions>({
|
||||
minify: TerserPlugin.uglifyJsMinify,
|
||||
terserOptions: {
|
||||
// `uglif-js` options
|
||||
},
|
||||
}),
|
||||
new TerserPlugin<EsbuildOptions>({
|
||||
minify: TerserPlugin.esbuildMinify,
|
||||
terserOptions: {
|
||||
// `esbuild` options
|
||||
},
|
||||
}),
|
||||
|
||||
// Alternative usage:
|
||||
new TerserPlugin<TerserOptions>({
|
||||
minify: TerserPlugin.terserMinify,
|
||||
terserOptions: {
|
||||
// `terser` options
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Please take a moment to read our contributing guidelines if you haven't yet done so.
|
||||
|
||||
[CONTRIBUTING](./.github/CONTRIBUTING.md)
|
||||
|
||||
## License
|
||||
|
||||
[MIT](./LICENSE)
|
||||
|
||||
[npm]: https://img.shields.io/npm/v/terser-webpack-plugin.svg
|
||||
[npm-url]: https://npmjs.com/package/terser-webpack-plugin
|
||||
[node]: https://img.shields.io/node/v/terser-webpack-plugin.svg
|
||||
[node-url]: https://nodejs.org
|
||||
[deps]: https://david-dm.org/webpack-contrib/terser-webpack-plugin.svg
|
||||
[deps-url]: https://david-dm.org/webpack-contrib/terser-webpack-plugin
|
||||
[tests]: https://github.com/webpack-contrib/terser-webpack-plugin/workflows/terser-webpack-plugin/badge.svg
|
||||
[tests-url]: https://github.com/webpack-contrib/terser-webpack-plugin/actions
|
||||
[cover]: https://codecov.io/gh/webpack-contrib/terser-webpack-plugin/branch/master/graph/badge.svg
|
||||
[cover-url]: https://codecov.io/gh/webpack-contrib/terser-webpack-plugin
|
||||
[chat]: https://img.shields.io/badge/gitter-webpack%2Fwebpack-brightgreen.svg
|
||||
[chat-url]: https://gitter.im/webpack/webpack
|
||||
[size]: https://packagephobia.now.sh/badge?p=terser-webpack-plugin
|
||||
[size-url]: https://packagephobia.now.sh/result?p=terser-webpack-plugin
|
||||
301
receipeServer/frontend_old/node_modules/terser-webpack-plugin/node_modules/source-map/CHANGELOG.md
generated
vendored
Normal file
301
receipeServer/frontend_old/node_modules/terser-webpack-plugin/node_modules/source-map/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,301 @@
|
||||
# Change Log
|
||||
|
||||
## 0.5.6
|
||||
|
||||
* Fix for regression when people were using numbers as names in source maps. See
|
||||
#236.
|
||||
|
||||
## 0.5.5
|
||||
|
||||
* Fix "regression" of unsupported, implementation behavior that half the world
|
||||
happens to have come to depend on. See #235.
|
||||
|
||||
* Fix regression involving function hoisting in SpiderMonkey. See #233.
|
||||
|
||||
## 0.5.4
|
||||
|
||||
* Large performance improvements to source-map serialization. See #228 and #229.
|
||||
|
||||
## 0.5.3
|
||||
|
||||
* Do not include unnecessary distribution files. See
|
||||
commit ef7006f8d1647e0a83fdc60f04f5a7ca54886f86.
|
||||
|
||||
## 0.5.2
|
||||
|
||||
* Include browser distributions of the library in package.json's `files`. See
|
||||
issue #212.
|
||||
|
||||
## 0.5.1
|
||||
|
||||
* Fix latent bugs in IndexedSourceMapConsumer.prototype._parseMappings. See
|
||||
ff05274becc9e6e1295ed60f3ea090d31d843379.
|
||||
|
||||
## 0.5.0
|
||||
|
||||
* Node 0.8 is no longer supported.
|
||||
|
||||
* Use webpack instead of dryice for bundling.
|
||||
|
||||
* Big speedups serializing source maps. See pull request #203.
|
||||
|
||||
* Fix a bug with `SourceMapConsumer.prototype.sourceContentFor` and sources that
|
||||
explicitly start with the source root. See issue #199.
|
||||
|
||||
## 0.4.4
|
||||
|
||||
* Fix an issue where using a `SourceMapGenerator` after having created a
|
||||
`SourceMapConsumer` from it via `SourceMapConsumer.fromSourceMap` failed. See
|
||||
issue #191.
|
||||
|
||||
* Fix an issue with where `SourceMapGenerator` would mistakenly consider
|
||||
different mappings as duplicates of each other and avoid generating them. See
|
||||
issue #192.
|
||||
|
||||
## 0.4.3
|
||||
|
||||
* A very large number of performance improvements, particularly when parsing
|
||||
source maps. Collectively about 75% of time shaved off of the source map
|
||||
parsing benchmark!
|
||||
|
||||
* Fix a bug in `SourceMapConsumer.prototype.allGeneratedPositionsFor` and fuzzy
|
||||
searching in the presence of a column option. See issue #177.
|
||||
|
||||
* Fix a bug with joining a source and its source root when the source is above
|
||||
the root. See issue #182.
|
||||
|
||||
* Add the `SourceMapConsumer.prototype.hasContentsOfAllSources` method to
|
||||
determine when all sources' contents are inlined into the source map. See
|
||||
issue #190.
|
||||
|
||||
## 0.4.2
|
||||
|
||||
* Add an `.npmignore` file so that the benchmarks aren't pulled down by
|
||||
dependent projects. Issue #169.
|
||||
|
||||
* Add an optional `column` argument to
|
||||
`SourceMapConsumer.prototype.allGeneratedPositionsFor` and better handle lines
|
||||
with no mappings. Issues #172 and #173.
|
||||
|
||||
## 0.4.1
|
||||
|
||||
* Fix accidentally defining a global variable. #170.
|
||||
|
||||
## 0.4.0
|
||||
|
||||
* The default direction for fuzzy searching was changed back to its original
|
||||
direction. See #164.
|
||||
|
||||
* There is now a `bias` option you can supply to `SourceMapConsumer` to control
|
||||
the fuzzy searching direction. See #167.
|
||||
|
||||
* About an 8% speed up in parsing source maps. See #159.
|
||||
|
||||
* Added a benchmark for parsing and generating source maps.
|
||||
|
||||
## 0.3.0
|
||||
|
||||
* Change the default direction that searching for positions fuzzes when there is
|
||||
not an exact match. See #154.
|
||||
|
||||
* Support for environments using json2.js for JSON serialization. See #156.
|
||||
|
||||
## 0.2.0
|
||||
|
||||
* Support for consuming "indexed" source maps which do not have any remote
|
||||
sections. See pull request #127. This introduces a minor backwards
|
||||
incompatibility if you are monkey patching `SourceMapConsumer.prototype`
|
||||
methods.
|
||||
|
||||
## 0.1.43
|
||||
|
||||
* Performance improvements for `SourceMapGenerator` and `SourceNode`. See issue
|
||||
#148 for some discussion and issues #150, #151, and #152 for implementations.
|
||||
|
||||
## 0.1.42
|
||||
|
||||
* Fix an issue where `SourceNode`s from different versions of the source-map
|
||||
library couldn't be used in conjunction with each other. See issue #142.
|
||||
|
||||
## 0.1.41
|
||||
|
||||
* Fix a bug with getting the source content of relative sources with a "./"
|
||||
prefix. See issue #145 and [Bug 1090768](bugzil.la/1090768).
|
||||
|
||||
* Add the `SourceMapConsumer.prototype.computeColumnSpans` method to compute the
|
||||
column span of each mapping.
|
||||
|
||||
* Add the `SourceMapConsumer.prototype.allGeneratedPositionsFor` method to find
|
||||
all generated positions associated with a given original source and line.
|
||||
|
||||
## 0.1.40
|
||||
|
||||
* Performance improvements for parsing source maps in SourceMapConsumer.
|
||||
|
||||
## 0.1.39
|
||||
|
||||
* Fix a bug where setting a source's contents to null before any source content
|
||||
had been set before threw a TypeError. See issue #131.
|
||||
|
||||
## 0.1.38
|
||||
|
||||
* Fix a bug where finding relative paths from an empty path were creating
|
||||
absolute paths. See issue #129.
|
||||
|
||||
## 0.1.37
|
||||
|
||||
* Fix a bug where if the source root was an empty string, relative source paths
|
||||
would turn into absolute source paths. Issue #124.
|
||||
|
||||
## 0.1.36
|
||||
|
||||
* Allow the `names` mapping property to be an empty string. Issue #121.
|
||||
|
||||
## 0.1.35
|
||||
|
||||
* A third optional parameter was added to `SourceNode.fromStringWithSourceMap`
|
||||
to specify a path that relative sources in the second parameter should be
|
||||
relative to. Issue #105.
|
||||
|
||||
* If no file property is given to a `SourceMapGenerator`, then the resulting
|
||||
source map will no longer have a `null` file property. The property will
|
||||
simply not exist. Issue #104.
|
||||
|
||||
* Fixed a bug where consecutive newlines were ignored in `SourceNode`s.
|
||||
Issue #116.
|
||||
|
||||
## 0.1.34
|
||||
|
||||
* Make `SourceNode` work with windows style ("\r\n") newlines. Issue #103.
|
||||
|
||||
* Fix bug involving source contents and the
|
||||
`SourceMapGenerator.prototype.applySourceMap`. Issue #100.
|
||||
|
||||
## 0.1.33
|
||||
|
||||
* Fix some edge cases surrounding path joining and URL resolution.
|
||||
|
||||
* Add a third parameter for relative path to
|
||||
`SourceMapGenerator.prototype.applySourceMap`.
|
||||
|
||||
* Fix issues with mappings and EOLs.
|
||||
|
||||
## 0.1.32
|
||||
|
||||
* Fixed a bug where SourceMapConsumer couldn't handle negative relative columns
|
||||
(issue 92).
|
||||
|
||||
* Fixed test runner to actually report number of failed tests as its process
|
||||
exit code.
|
||||
|
||||
* Fixed a typo when reporting bad mappings (issue 87).
|
||||
|
||||
## 0.1.31
|
||||
|
||||
* Delay parsing the mappings in SourceMapConsumer until queried for a source
|
||||
location.
|
||||
|
||||
* Support Sass source maps (which at the time of writing deviate from the spec
|
||||
in small ways) in SourceMapConsumer.
|
||||
|
||||
## 0.1.30
|
||||
|
||||
* Do not join source root with a source, when the source is a data URI.
|
||||
|
||||
* Extend the test runner to allow running single specific test files at a time.
|
||||
|
||||
* Performance improvements in `SourceNode.prototype.walk` and
|
||||
`SourceMapConsumer.prototype.eachMapping`.
|
||||
|
||||
* Source map browser builds will now work inside Workers.
|
||||
|
||||
* Better error messages when attempting to add an invalid mapping to a
|
||||
`SourceMapGenerator`.
|
||||
|
||||
## 0.1.29
|
||||
|
||||
* Allow duplicate entries in the `names` and `sources` arrays of source maps
|
||||
(usually from TypeScript) we are parsing. Fixes github issue 72.
|
||||
|
||||
## 0.1.28
|
||||
|
||||
* Skip duplicate mappings when creating source maps from SourceNode; github
|
||||
issue 75.
|
||||
|
||||
## 0.1.27
|
||||
|
||||
* Don't throw an error when the `file` property is missing in SourceMapConsumer,
|
||||
we don't use it anyway.
|
||||
|
||||
## 0.1.26
|
||||
|
||||
* Fix SourceNode.fromStringWithSourceMap for empty maps. Fixes github issue 70.
|
||||
|
||||
## 0.1.25
|
||||
|
||||
* Make compatible with browserify
|
||||
|
||||
## 0.1.24
|
||||
|
||||
* Fix issue with absolute paths and `file://` URIs. See
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=885597
|
||||
|
||||
## 0.1.23
|
||||
|
||||
* Fix issue with absolute paths and sourcesContent, github issue 64.
|
||||
|
||||
## 0.1.22
|
||||
|
||||
* Ignore duplicate mappings in SourceMapGenerator. Fixes github issue 21.
|
||||
|
||||
## 0.1.21
|
||||
|
||||
* Fixed handling of sources that start with a slash so that they are relative to
|
||||
the source root's host.
|
||||
|
||||
## 0.1.20
|
||||
|
||||
* Fixed github issue #43: absolute URLs aren't joined with the source root
|
||||
anymore.
|
||||
|
||||
## 0.1.19
|
||||
|
||||
* Using Travis CI to run tests.
|
||||
|
||||
## 0.1.18
|
||||
|
||||
* Fixed a bug in the handling of sourceRoot.
|
||||
|
||||
## 0.1.17
|
||||
|
||||
* Added SourceNode.fromStringWithSourceMap.
|
||||
|
||||
## 0.1.16
|
||||
|
||||
* Added missing documentation.
|
||||
|
||||
* Fixed the generating of empty mappings in SourceNode.
|
||||
|
||||
## 0.1.15
|
||||
|
||||
* Added SourceMapGenerator.applySourceMap.
|
||||
|
||||
## 0.1.14
|
||||
|
||||
* The sourceRoot is now handled consistently.
|
||||
|
||||
## 0.1.13
|
||||
|
||||
* Added SourceMapGenerator.fromSourceMap.
|
||||
|
||||
## 0.1.12
|
||||
|
||||
* SourceNode now generates empty mappings too.
|
||||
|
||||
## 0.1.11
|
||||
|
||||
* Added name support to SourceNode.
|
||||
|
||||
## 0.1.10
|
||||
|
||||
* Added sourcesContent support to the customer and generator.
|
||||
28
receipeServer/frontend_old/node_modules/terser-webpack-plugin/node_modules/source-map/LICENSE
generated
vendored
Normal file
28
receipeServer/frontend_old/node_modules/terser-webpack-plugin/node_modules/source-map/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
Copyright (c) 2009-2011, Mozilla Foundation and contributors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the names of the Mozilla Foundation nor the names of project
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
742
receipeServer/frontend_old/node_modules/terser-webpack-plugin/node_modules/source-map/README.md
generated
vendored
Normal file
742
receipeServer/frontend_old/node_modules/terser-webpack-plugin/node_modules/source-map/README.md
generated
vendored
Normal file
@@ -0,0 +1,742 @@
|
||||
# Source Map
|
||||
|
||||
[](https://travis-ci.org/mozilla/source-map)
|
||||
|
||||
[](https://www.npmjs.com/package/source-map)
|
||||
|
||||
This is a library to generate and consume the source map format
|
||||
[described here][format].
|
||||
|
||||
[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit
|
||||
|
||||
## Use with Node
|
||||
|
||||
$ npm install source-map
|
||||
|
||||
## Use on the Web
|
||||
|
||||
<script src="https://raw.githubusercontent.com/mozilla/source-map/master/dist/source-map.min.js" defer></script>
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
<!-- `npm run toc` to regenerate the Table of Contents -->
|
||||
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
## Table of Contents
|
||||
|
||||
- [Examples](#examples)
|
||||
- [Consuming a source map](#consuming-a-source-map)
|
||||
- [Generating a source map](#generating-a-source-map)
|
||||
- [With SourceNode (high level API)](#with-sourcenode-high-level-api)
|
||||
- [With SourceMapGenerator (low level API)](#with-sourcemapgenerator-low-level-api)
|
||||
- [API](#api)
|
||||
- [SourceMapConsumer](#sourcemapconsumer)
|
||||
- [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap)
|
||||
- [SourceMapConsumer.prototype.computeColumnSpans()](#sourcemapconsumerprototypecomputecolumnspans)
|
||||
- [SourceMapConsumer.prototype.originalPositionFor(generatedPosition)](#sourcemapconsumerprototypeoriginalpositionforgeneratedposition)
|
||||
- [SourceMapConsumer.prototype.generatedPositionFor(originalPosition)](#sourcemapconsumerprototypegeneratedpositionfororiginalposition)
|
||||
- [SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)](#sourcemapconsumerprototypeallgeneratedpositionsfororiginalposition)
|
||||
- [SourceMapConsumer.prototype.hasContentsOfAllSources()](#sourcemapconsumerprototypehascontentsofallsources)
|
||||
- [SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])](#sourcemapconsumerprototypesourcecontentforsource-returnnullonmissing)
|
||||
- [SourceMapConsumer.prototype.eachMapping(callback, context, order)](#sourcemapconsumerprototypeeachmappingcallback-context-order)
|
||||
- [SourceMapGenerator](#sourcemapgenerator)
|
||||
- [new SourceMapGenerator([startOfSourceMap])](#new-sourcemapgeneratorstartofsourcemap)
|
||||
- [SourceMapGenerator.fromSourceMap(sourceMapConsumer)](#sourcemapgeneratorfromsourcemapsourcemapconsumer)
|
||||
- [SourceMapGenerator.prototype.addMapping(mapping)](#sourcemapgeneratorprototypeaddmappingmapping)
|
||||
- [SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)](#sourcemapgeneratorprototypesetsourcecontentsourcefile-sourcecontent)
|
||||
- [SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])](#sourcemapgeneratorprototypeapplysourcemapsourcemapconsumer-sourcefile-sourcemappath)
|
||||
- [SourceMapGenerator.prototype.toString()](#sourcemapgeneratorprototypetostring)
|
||||
- [SourceNode](#sourcenode)
|
||||
- [new SourceNode([line, column, source[, chunk[, name]]])](#new-sourcenodeline-column-source-chunk-name)
|
||||
- [SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])](#sourcenodefromstringwithsourcemapcode-sourcemapconsumer-relativepath)
|
||||
- [SourceNode.prototype.add(chunk)](#sourcenodeprototypeaddchunk)
|
||||
- [SourceNode.prototype.prepend(chunk)](#sourcenodeprototypeprependchunk)
|
||||
- [SourceNode.prototype.setSourceContent(sourceFile, sourceContent)](#sourcenodeprototypesetsourcecontentsourcefile-sourcecontent)
|
||||
- [SourceNode.prototype.walk(fn)](#sourcenodeprototypewalkfn)
|
||||
- [SourceNode.prototype.walkSourceContents(fn)](#sourcenodeprototypewalksourcecontentsfn)
|
||||
- [SourceNode.prototype.join(sep)](#sourcenodeprototypejoinsep)
|
||||
- [SourceNode.prototype.replaceRight(pattern, replacement)](#sourcenodeprototypereplacerightpattern-replacement)
|
||||
- [SourceNode.prototype.toString()](#sourcenodeprototypetostring)
|
||||
- [SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])](#sourcenodeprototypetostringwithsourcemapstartofsourcemap)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
## Examples
|
||||
|
||||
### Consuming a source map
|
||||
|
||||
```js
|
||||
var rawSourceMap = {
|
||||
version: 3,
|
||||
file: 'min.js',
|
||||
names: ['bar', 'baz', 'n'],
|
||||
sources: ['one.js', 'two.js'],
|
||||
sourceRoot: 'http://example.com/www/js/',
|
||||
mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
|
||||
};
|
||||
|
||||
var smc = new SourceMapConsumer(rawSourceMap);
|
||||
|
||||
console.log(smc.sources);
|
||||
// [ 'http://example.com/www/js/one.js',
|
||||
// 'http://example.com/www/js/two.js' ]
|
||||
|
||||
console.log(smc.originalPositionFor({
|
||||
line: 2,
|
||||
column: 28
|
||||
}));
|
||||
// { source: 'http://example.com/www/js/two.js',
|
||||
// line: 2,
|
||||
// column: 10,
|
||||
// name: 'n' }
|
||||
|
||||
console.log(smc.generatedPositionFor({
|
||||
source: 'http://example.com/www/js/two.js',
|
||||
line: 2,
|
||||
column: 10
|
||||
}));
|
||||
// { line: 2, column: 28 }
|
||||
|
||||
smc.eachMapping(function (m) {
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
### Generating a source map
|
||||
|
||||
In depth guide:
|
||||
[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/)
|
||||
|
||||
#### With SourceNode (high level API)
|
||||
|
||||
```js
|
||||
function compile(ast) {
|
||||
switch (ast.type) {
|
||||
case 'BinaryExpression':
|
||||
return new SourceNode(
|
||||
ast.location.line,
|
||||
ast.location.column,
|
||||
ast.location.source,
|
||||
[compile(ast.left), " + ", compile(ast.right)]
|
||||
);
|
||||
case 'Literal':
|
||||
return new SourceNode(
|
||||
ast.location.line,
|
||||
ast.location.column,
|
||||
ast.location.source,
|
||||
String(ast.value)
|
||||
);
|
||||
// ...
|
||||
default:
|
||||
throw new Error("Bad AST");
|
||||
}
|
||||
}
|
||||
|
||||
var ast = parse("40 + 2", "add.js");
|
||||
console.log(compile(ast).toStringWithSourceMap({
|
||||
file: 'add.js'
|
||||
}));
|
||||
// { code: '40 + 2',
|
||||
// map: [object SourceMapGenerator] }
|
||||
```
|
||||
|
||||
#### With SourceMapGenerator (low level API)
|
||||
|
||||
```js
|
||||
var map = new SourceMapGenerator({
|
||||
file: "source-mapped.js"
|
||||
});
|
||||
|
||||
map.addMapping({
|
||||
generated: {
|
||||
line: 10,
|
||||
column: 35
|
||||
},
|
||||
source: "foo.js",
|
||||
original: {
|
||||
line: 33,
|
||||
column: 2
|
||||
},
|
||||
name: "christopher"
|
||||
});
|
||||
|
||||
console.log(map.toString());
|
||||
// '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}'
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
Get a reference to the module:
|
||||
|
||||
```js
|
||||
// Node.js
|
||||
var sourceMap = require('source-map');
|
||||
|
||||
// Browser builds
|
||||
var sourceMap = window.sourceMap;
|
||||
|
||||
// Inside Firefox
|
||||
const sourceMap = require("devtools/toolkit/sourcemap/source-map.js");
|
||||
```
|
||||
|
||||
### SourceMapConsumer
|
||||
|
||||
A SourceMapConsumer instance represents a parsed source map which we can query
|
||||
for information about the original file positions by giving it a file position
|
||||
in the generated source.
|
||||
|
||||
#### new SourceMapConsumer(rawSourceMap)
|
||||
|
||||
The only parameter is the raw source map (either as a string which can be
|
||||
`JSON.parse`'d, or an object). According to the spec, source maps have the
|
||||
following attributes:
|
||||
|
||||
* `version`: Which version of the source map spec this map is following.
|
||||
|
||||
* `sources`: An array of URLs to the original source files.
|
||||
|
||||
* `names`: An array of identifiers which can be referenced by individual
|
||||
mappings.
|
||||
|
||||
* `sourceRoot`: Optional. The URL root from which all sources are relative.
|
||||
|
||||
* `sourcesContent`: Optional. An array of contents of the original source files.
|
||||
|
||||
* `mappings`: A string of base64 VLQs which contain the actual mappings.
|
||||
|
||||
* `file`: Optional. The generated filename this source map is associated with.
|
||||
|
||||
```js
|
||||
var consumer = new sourceMap.SourceMapConsumer(rawSourceMapJsonData);
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.computeColumnSpans()
|
||||
|
||||
Compute the last column for each generated mapping. The last column is
|
||||
inclusive.
|
||||
|
||||
```js
|
||||
// Before:
|
||||
consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" })
|
||||
// [ { line: 2,
|
||||
// column: 1 },
|
||||
// { line: 2,
|
||||
// column: 10 },
|
||||
// { line: 2,
|
||||
// column: 20 } ]
|
||||
|
||||
consumer.computeColumnSpans();
|
||||
|
||||
// After:
|
||||
consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" })
|
||||
// [ { line: 2,
|
||||
// column: 1,
|
||||
// lastColumn: 9 },
|
||||
// { line: 2,
|
||||
// column: 10,
|
||||
// lastColumn: 19 },
|
||||
// { line: 2,
|
||||
// column: 20,
|
||||
// lastColumn: Infinity } ]
|
||||
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition)
|
||||
|
||||
Returns the original source, line, and column information for the generated
|
||||
source's line and column positions provided. The only argument is an object with
|
||||
the following properties:
|
||||
|
||||
* `line`: The line number in the generated source. Line numbers in
|
||||
this library are 1-based (note that the underlying source map
|
||||
specification uses 0-based line numbers -- this library handles the
|
||||
translation).
|
||||
|
||||
* `column`: The column number in the generated source. Column numbers
|
||||
in this library are 0-based.
|
||||
|
||||
* `bias`: Either `SourceMapConsumer.GREATEST_LOWER_BOUND` or
|
||||
`SourceMapConsumer.LEAST_UPPER_BOUND`. Specifies whether to return the closest
|
||||
element that is smaller than or greater than the one we are searching for,
|
||||
respectively, if the exact element cannot be found. Defaults to
|
||||
`SourceMapConsumer.GREATEST_LOWER_BOUND`.
|
||||
|
||||
and an object is returned with the following properties:
|
||||
|
||||
* `source`: The original source file, or null if this information is not
|
||||
available.
|
||||
|
||||
* `line`: The line number in the original source, or null if this information is
|
||||
not available. The line number is 1-based.
|
||||
|
||||
* `column`: The column number in the original source, or null if this
|
||||
information is not available. The column number is 0-based.
|
||||
|
||||
* `name`: The original identifier, or null if this information is not available.
|
||||
|
||||
```js
|
||||
consumer.originalPositionFor({ line: 2, column: 10 })
|
||||
// { source: 'foo.coffee',
|
||||
// line: 2,
|
||||
// column: 2,
|
||||
// name: null }
|
||||
|
||||
consumer.originalPositionFor({ line: 99999999999999999, column: 999999999999999 })
|
||||
// { source: null,
|
||||
// line: null,
|
||||
// column: null,
|
||||
// name: null }
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition)
|
||||
|
||||
Returns the generated line and column information for the original source,
|
||||
line, and column positions provided. The only argument is an object with
|
||||
the following properties:
|
||||
|
||||
* `source`: The filename of the original source.
|
||||
|
||||
* `line`: The line number in the original source. The line number is
|
||||
1-based.
|
||||
|
||||
* `column`: The column number in the original source. The column
|
||||
number is 0-based.
|
||||
|
||||
and an object is returned with the following properties:
|
||||
|
||||
* `line`: The line number in the generated source, or null. The line
|
||||
number is 1-based.
|
||||
|
||||
* `column`: The column number in the generated source, or null. The
|
||||
column number is 0-based.
|
||||
|
||||
```js
|
||||
consumer.generatedPositionFor({ source: "example.js", line: 2, column: 10 })
|
||||
// { line: 1,
|
||||
// column: 56 }
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)
|
||||
|
||||
Returns all generated line and column information for the original source, line,
|
||||
and column provided. If no column is provided, returns all mappings
|
||||
corresponding to a either the line we are searching for or the next closest line
|
||||
that has any mappings. Otherwise, returns all mappings corresponding to the
|
||||
given line and either the column we are searching for or the next closest column
|
||||
that has any offsets.
|
||||
|
||||
The only argument is an object with the following properties:
|
||||
|
||||
* `source`: The filename of the original source.
|
||||
|
||||
* `line`: The line number in the original source. The line number is
|
||||
1-based.
|
||||
|
||||
* `column`: Optional. The column number in the original source. The
|
||||
column number is 0-based.
|
||||
|
||||
and an array of objects is returned, each with the following properties:
|
||||
|
||||
* `line`: The line number in the generated source, or null. The line
|
||||
number is 1-based.
|
||||
|
||||
* `column`: The column number in the generated source, or null. The
|
||||
column number is 0-based.
|
||||
|
||||
```js
|
||||
consumer.allGeneratedpositionsfor({ line: 2, source: "foo.coffee" })
|
||||
// [ { line: 2,
|
||||
// column: 1 },
|
||||
// { line: 2,
|
||||
// column: 10 },
|
||||
// { line: 2,
|
||||
// column: 20 } ]
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.hasContentsOfAllSources()
|
||||
|
||||
Return true if we have the embedded source content for every source listed in
|
||||
the source map, false otherwise.
|
||||
|
||||
In other words, if this method returns `true`, then
|
||||
`consumer.sourceContentFor(s)` will succeed for every source `s` in
|
||||
`consumer.sources`.
|
||||
|
||||
```js
|
||||
// ...
|
||||
if (consumer.hasContentsOfAllSources()) {
|
||||
consumerReadyCallback(consumer);
|
||||
} else {
|
||||
fetchSources(consumer, consumerReadyCallback);
|
||||
}
|
||||
// ...
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])
|
||||
|
||||
Returns the original source content for the source provided. The only
|
||||
argument is the URL of the original source file.
|
||||
|
||||
If the source content for the given source is not found, then an error is
|
||||
thrown. Optionally, pass `true` as the second param to have `null` returned
|
||||
instead.
|
||||
|
||||
```js
|
||||
consumer.sources
|
||||
// [ "my-cool-lib.clj" ]
|
||||
|
||||
consumer.sourceContentFor("my-cool-lib.clj")
|
||||
// "..."
|
||||
|
||||
consumer.sourceContentFor("this is not in the source map");
|
||||
// Error: "this is not in the source map" is not in the source map
|
||||
|
||||
consumer.sourceContentFor("this is not in the source map", true);
|
||||
// null
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.eachMapping(callback, context, order)
|
||||
|
||||
Iterate over each mapping between an original source/line/column and a
|
||||
generated line/column in this source map.
|
||||
|
||||
* `callback`: The function that is called with each mapping. Mappings have the
|
||||
form `{ source, generatedLine, generatedColumn, originalLine, originalColumn,
|
||||
name }`
|
||||
|
||||
* `context`: Optional. If specified, this object will be the value of `this`
|
||||
every time that `callback` is called.
|
||||
|
||||
* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or
|
||||
`SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over
|
||||
the mappings sorted by the generated file's line/column order or the
|
||||
original's source/line/column order, respectively. Defaults to
|
||||
`SourceMapConsumer.GENERATED_ORDER`.
|
||||
|
||||
```js
|
||||
consumer.eachMapping(function (m) { console.log(m); })
|
||||
// ...
|
||||
// { source: 'illmatic.js',
|
||||
// generatedLine: 1,
|
||||
// generatedColumn: 0,
|
||||
// originalLine: 1,
|
||||
// originalColumn: 0,
|
||||
// name: null }
|
||||
// { source: 'illmatic.js',
|
||||
// generatedLine: 2,
|
||||
// generatedColumn: 0,
|
||||
// originalLine: 2,
|
||||
// originalColumn: 0,
|
||||
// name: null }
|
||||
// ...
|
||||
```
|
||||
### SourceMapGenerator
|
||||
|
||||
An instance of the SourceMapGenerator represents a source map which is being
|
||||
built incrementally.
|
||||
|
||||
#### new SourceMapGenerator([startOfSourceMap])
|
||||
|
||||
You may pass an object with the following properties:
|
||||
|
||||
* `file`: The filename of the generated source that this source map is
|
||||
associated with.
|
||||
|
||||
* `sourceRoot`: A root for all relative URLs in this source map.
|
||||
|
||||
* `skipValidation`: Optional. When `true`, disables validation of mappings as
|
||||
they are added. This can improve performance but should be used with
|
||||
discretion, as a last resort. Even then, one should avoid using this flag when
|
||||
running tests, if possible.
|
||||
|
||||
```js
|
||||
var generator = new sourceMap.SourceMapGenerator({
|
||||
file: "my-generated-javascript-file.js",
|
||||
sourceRoot: "http://example.com/app/js/"
|
||||
});
|
||||
```
|
||||
|
||||
#### SourceMapGenerator.fromSourceMap(sourceMapConsumer)
|
||||
|
||||
Creates a new `SourceMapGenerator` from an existing `SourceMapConsumer` instance.
|
||||
|
||||
* `sourceMapConsumer` The SourceMap.
|
||||
|
||||
```js
|
||||
var generator = sourceMap.SourceMapGenerator.fromSourceMap(consumer);
|
||||
```
|
||||
|
||||
#### SourceMapGenerator.prototype.addMapping(mapping)
|
||||
|
||||
Add a single mapping from original source line and column to the generated
|
||||
source's line and column for this source map being created. The mapping object
|
||||
should have the following properties:
|
||||
|
||||
* `generated`: An object with the generated line and column positions.
|
||||
|
||||
* `original`: An object with the original line and column positions.
|
||||
|
||||
* `source`: The original source file (relative to the sourceRoot).
|
||||
|
||||
* `name`: An optional original token name for this mapping.
|
||||
|
||||
```js
|
||||
generator.addMapping({
|
||||
source: "module-one.scm",
|
||||
original: { line: 128, column: 0 },
|
||||
generated: { line: 3, column: 456 }
|
||||
})
|
||||
```
|
||||
|
||||
#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)
|
||||
|
||||
Set the source content for an original source file.
|
||||
|
||||
* `sourceFile` the URL of the original source file.
|
||||
|
||||
* `sourceContent` the content of the source file.
|
||||
|
||||
```js
|
||||
generator.setSourceContent("module-one.scm",
|
||||
fs.readFileSync("path/to/module-one.scm"))
|
||||
```
|
||||
|
||||
#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])
|
||||
|
||||
Applies a SourceMap for a source file to the SourceMap.
|
||||
Each mapping to the supplied source file is rewritten using the
|
||||
supplied SourceMap. Note: The resolution for the resulting mappings
|
||||
is the minimum of this map and the supplied map.
|
||||
|
||||
* `sourceMapConsumer`: The SourceMap to be applied.
|
||||
|
||||
* `sourceFile`: Optional. The filename of the source file.
|
||||
If omitted, sourceMapConsumer.file will be used, if it exists.
|
||||
Otherwise an error will be thrown.
|
||||
|
||||
* `sourceMapPath`: Optional. The dirname of the path to the SourceMap
|
||||
to be applied. If relative, it is relative to the SourceMap.
|
||||
|
||||
This parameter is needed when the two SourceMaps aren't in the same
|
||||
directory, and the SourceMap to be applied contains relative source
|
||||
paths. If so, those relative source paths need to be rewritten
|
||||
relative to the SourceMap.
|
||||
|
||||
If omitted, it is assumed that both SourceMaps are in the same directory,
|
||||
thus not needing any rewriting. (Supplying `'.'` has the same effect.)
|
||||
|
||||
#### SourceMapGenerator.prototype.toString()
|
||||
|
||||
Renders the source map being generated to a string.
|
||||
|
||||
```js
|
||||
generator.toString()
|
||||
// '{"version":3,"sources":["module-one.scm"],"names":[],"mappings":"...snip...","file":"my-generated-javascript-file.js","sourceRoot":"http://example.com/app/js/"}'
|
||||
```
|
||||
|
||||
### SourceNode
|
||||
|
||||
SourceNodes provide a way to abstract over interpolating and/or concatenating
|
||||
snippets of generated JavaScript source code, while maintaining the line and
|
||||
column information associated between those snippets and the original source
|
||||
code. This is useful as the final intermediate representation a compiler might
|
||||
use before outputting the generated JS and source map.
|
||||
|
||||
#### new SourceNode([line, column, source[, chunk[, name]]])
|
||||
|
||||
* `line`: The original line number associated with this source node, or null if
|
||||
it isn't associated with an original line. The line number is 1-based.
|
||||
|
||||
* `column`: The original column number associated with this source node, or null
|
||||
if it isn't associated with an original column. The column number
|
||||
is 0-based.
|
||||
|
||||
* `source`: The original source's filename; null if no filename is provided.
|
||||
|
||||
* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see
|
||||
below.
|
||||
|
||||
* `name`: Optional. The original identifier.
|
||||
|
||||
```js
|
||||
var node = new SourceNode(1, 2, "a.cpp", [
|
||||
new SourceNode(3, 4, "b.cpp", "extern int status;\n"),
|
||||
new SourceNode(5, 6, "c.cpp", "std::string* make_string(size_t n);\n"),
|
||||
new SourceNode(7, 8, "d.cpp", "int main(int argc, char** argv) {}\n"),
|
||||
]);
|
||||
```
|
||||
|
||||
#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])
|
||||
|
||||
Creates a SourceNode from generated code and a SourceMapConsumer.
|
||||
|
||||
* `code`: The generated code
|
||||
|
||||
* `sourceMapConsumer` The SourceMap for the generated code
|
||||
|
||||
* `relativePath` The optional path that relative sources in `sourceMapConsumer`
|
||||
should be relative to.
|
||||
|
||||
```js
|
||||
var consumer = new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map", "utf8"));
|
||||
var node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"),
|
||||
consumer);
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.add(chunk)
|
||||
|
||||
Add a chunk of generated JS to this source node.
|
||||
|
||||
* `chunk`: A string snippet of generated JS code, another instance of
|
||||
`SourceNode`, or an array where each member is one of those things.
|
||||
|
||||
```js
|
||||
node.add(" + ");
|
||||
node.add(otherNode);
|
||||
node.add([leftHandOperandNode, " + ", rightHandOperandNode]);
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.prepend(chunk)
|
||||
|
||||
Prepend a chunk of generated JS to this source node.
|
||||
|
||||
* `chunk`: A string snippet of generated JS code, another instance of
|
||||
`SourceNode`, or an array where each member is one of those things.
|
||||
|
||||
```js
|
||||
node.prepend("/** Build Id: f783haef86324gf **/\n\n");
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent)
|
||||
|
||||
Set the source content for a source file. This will be added to the
|
||||
`SourceMap` in the `sourcesContent` field.
|
||||
|
||||
* `sourceFile`: The filename of the source file
|
||||
|
||||
* `sourceContent`: The content of the source file
|
||||
|
||||
```js
|
||||
node.setSourceContent("module-one.scm",
|
||||
fs.readFileSync("path/to/module-one.scm"))
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.walk(fn)
|
||||
|
||||
Walk over the tree of JS snippets in this node and its children. The walking
|
||||
function is called once for each snippet of JS and is passed that snippet and
|
||||
the its original associated source's line/column location.
|
||||
|
||||
* `fn`: The traversal function.
|
||||
|
||||
```js
|
||||
var node = new SourceNode(1, 2, "a.js", [
|
||||
new SourceNode(3, 4, "b.js", "uno"),
|
||||
"dos",
|
||||
[
|
||||
"tres",
|
||||
new SourceNode(5, 6, "c.js", "quatro")
|
||||
]
|
||||
]);
|
||||
|
||||
node.walk(function (code, loc) { console.log("WALK:", code, loc); })
|
||||
// WALK: uno { source: 'b.js', line: 3, column: 4, name: null }
|
||||
// WALK: dos { source: 'a.js', line: 1, column: 2, name: null }
|
||||
// WALK: tres { source: 'a.js', line: 1, column: 2, name: null }
|
||||
// WALK: quatro { source: 'c.js', line: 5, column: 6, name: null }
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.walkSourceContents(fn)
|
||||
|
||||
Walk over the tree of SourceNodes. The walking function is called for each
|
||||
source file content and is passed the filename and source content.
|
||||
|
||||
* `fn`: The traversal function.
|
||||
|
||||
```js
|
||||
var a = new SourceNode(1, 2, "a.js", "generated from a");
|
||||
a.setSourceContent("a.js", "original a");
|
||||
var b = new SourceNode(1, 2, "b.js", "generated from b");
|
||||
b.setSourceContent("b.js", "original b");
|
||||
var c = new SourceNode(1, 2, "c.js", "generated from c");
|
||||
c.setSourceContent("c.js", "original c");
|
||||
|
||||
var node = new SourceNode(null, null, null, [a, b, c]);
|
||||
node.walkSourceContents(function (source, contents) { console.log("WALK:", source, ":", contents); })
|
||||
// WALK: a.js : original a
|
||||
// WALK: b.js : original b
|
||||
// WALK: c.js : original c
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.join(sep)
|
||||
|
||||
Like `Array.prototype.join` except for SourceNodes. Inserts the separator
|
||||
between each of this source node's children.
|
||||
|
||||
* `sep`: The separator.
|
||||
|
||||
```js
|
||||
var lhs = new SourceNode(1, 2, "a.rs", "my_copy");
|
||||
var operand = new SourceNode(3, 4, "a.rs", "=");
|
||||
var rhs = new SourceNode(5, 6, "a.rs", "orig.clone()");
|
||||
|
||||
var node = new SourceNode(null, null, null, [ lhs, operand, rhs ]);
|
||||
var joinedNode = node.join(" ");
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.replaceRight(pattern, replacement)
|
||||
|
||||
Call `String.prototype.replace` on the very right-most source snippet. Useful
|
||||
for trimming white space from the end of a source node, etc.
|
||||
|
||||
* `pattern`: The pattern to replace.
|
||||
|
||||
* `replacement`: The thing to replace the pattern with.
|
||||
|
||||
```js
|
||||
// Trim trailing white space.
|
||||
node.replaceRight(/\s*$/, "");
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.toString()
|
||||
|
||||
Return the string representation of this source node. Walks over the tree and
|
||||
concatenates all the various snippets together to one string.
|
||||
|
||||
```js
|
||||
var node = new SourceNode(1, 2, "a.js", [
|
||||
new SourceNode(3, 4, "b.js", "uno"),
|
||||
"dos",
|
||||
[
|
||||
"tres",
|
||||
new SourceNode(5, 6, "c.js", "quatro")
|
||||
]
|
||||
]);
|
||||
|
||||
node.toString()
|
||||
// 'unodostresquatro'
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])
|
||||
|
||||
Returns the string representation of this tree of source nodes, plus a
|
||||
SourceMapGenerator which contains all the mappings between the generated and
|
||||
original sources.
|
||||
|
||||
The arguments are the same as those to `new SourceMapGenerator`.
|
||||
|
||||
```js
|
||||
var node = new SourceNode(1, 2, "a.js", [
|
||||
new SourceNode(3, 4, "b.js", "uno"),
|
||||
"dos",
|
||||
[
|
||||
"tres",
|
||||
new SourceNode(5, 6, "c.js", "quatro")
|
||||
]
|
||||
]);
|
||||
|
||||
node.toStringWithSourceMap({ file: "my-output-file.js" })
|
||||
// { code: 'unodostresquatro',
|
||||
// map: [object SourceMapGenerator] }
|
||||
```
|
||||
73
receipeServer/frontend_old/node_modules/terser-webpack-plugin/node_modules/source-map/package.json
generated
vendored
Normal file
73
receipeServer/frontend_old/node_modules/terser-webpack-plugin/node_modules/source-map/package.json
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"name": "source-map",
|
||||
"description": "Generates and consumes source maps",
|
||||
"version": "0.6.1",
|
||||
"homepage": "https://github.com/mozilla/source-map",
|
||||
"author": "Nick Fitzgerald <nfitzgerald@mozilla.com>",
|
||||
"contributors": [
|
||||
"Tobias Koppers <tobias.koppers@googlemail.com>",
|
||||
"Duncan Beevers <duncan@dweebd.com>",
|
||||
"Stephen Crane <scrane@mozilla.com>",
|
||||
"Ryan Seddon <seddon.ryan@gmail.com>",
|
||||
"Miles Elam <miles.elam@deem.com>",
|
||||
"Mihai Bazon <mihai.bazon@gmail.com>",
|
||||
"Michael Ficarra <github.public.email@michael.ficarra.me>",
|
||||
"Todd Wolfson <todd@twolfson.com>",
|
||||
"Alexander Solovyov <alexander@solovyov.net>",
|
||||
"Felix Gnass <fgnass@gmail.com>",
|
||||
"Conrad Irwin <conrad.irwin@gmail.com>",
|
||||
"usrbincc <usrbincc@yahoo.com>",
|
||||
"David Glasser <glasser@davidglasser.net>",
|
||||
"Chase Douglas <chase@newrelic.com>",
|
||||
"Evan Wallace <evan.exe@gmail.com>",
|
||||
"Heather Arthur <fayearthur@gmail.com>",
|
||||
"Hugh Kennedy <hughskennedy@gmail.com>",
|
||||
"David Glasser <glasser@davidglasser.net>",
|
||||
"Simon Lydell <simon.lydell@gmail.com>",
|
||||
"Jmeas Smith <jellyes2@gmail.com>",
|
||||
"Michael Z Goddard <mzgoddard@gmail.com>",
|
||||
"azu <azu@users.noreply.github.com>",
|
||||
"John Gozde <john@gozde.ca>",
|
||||
"Adam Kirkton <akirkton@truefitinnovation.com>",
|
||||
"Chris Montgomery <christopher.montgomery@dowjones.com>",
|
||||
"J. Ryan Stinnett <jryans@gmail.com>",
|
||||
"Jack Herrington <jherrington@walmartlabs.com>",
|
||||
"Chris Truter <jeffpalentine@gmail.com>",
|
||||
"Daniel Espeset <daniel@danielespeset.com>",
|
||||
"Jamie Wong <jamie.lf.wong@gmail.com>",
|
||||
"Eddy Bruël <ejpbruel@mozilla.com>",
|
||||
"Hawken Rives <hawkrives@gmail.com>",
|
||||
"Gilad Peleg <giladp007@gmail.com>",
|
||||
"djchie <djchie.dev@gmail.com>",
|
||||
"Gary Ye <garysye@gmail.com>",
|
||||
"Nicolas Lalevée <nicolas.lalevee@hibnet.org>"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://github.com/mozilla/source-map.git"
|
||||
},
|
||||
"main": "./source-map.js",
|
||||
"files": [
|
||||
"source-map.js",
|
||||
"source-map.d.ts",
|
||||
"lib/",
|
||||
"dist/source-map.debug.js",
|
||||
"dist/source-map.js",
|
||||
"dist/source-map.min.js",
|
||||
"dist/source-map.min.js.map"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"license": "BSD-3-Clause",
|
||||
"scripts": {
|
||||
"test": "npm run build && node test/run-tests.js",
|
||||
"build": "webpack --color",
|
||||
"toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md"
|
||||
},
|
||||
"devDependencies": {
|
||||
"doctoc": "^0.15.0",
|
||||
"webpack": "^1.12.0"
|
||||
},
|
||||
"typings": "source-map"
|
||||
}
|
||||
98
receipeServer/frontend_old/node_modules/terser-webpack-plugin/node_modules/source-map/source-map.d.ts
generated
vendored
Normal file
98
receipeServer/frontend_old/node_modules/terser-webpack-plugin/node_modules/source-map/source-map.d.ts
generated
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
export interface StartOfSourceMap {
|
||||
file?: string;
|
||||
sourceRoot?: string;
|
||||
}
|
||||
|
||||
export interface RawSourceMap extends StartOfSourceMap {
|
||||
version: string;
|
||||
sources: string[];
|
||||
names: string[];
|
||||
sourcesContent?: string[];
|
||||
mappings: string;
|
||||
}
|
||||
|
||||
export interface Position {
|
||||
line: number;
|
||||
column: number;
|
||||
}
|
||||
|
||||
export interface LineRange extends Position {
|
||||
lastColumn: number;
|
||||
}
|
||||
|
||||
export interface FindPosition extends Position {
|
||||
// SourceMapConsumer.GREATEST_LOWER_BOUND or SourceMapConsumer.LEAST_UPPER_BOUND
|
||||
bias?: number;
|
||||
}
|
||||
|
||||
export interface SourceFindPosition extends FindPosition {
|
||||
source: string;
|
||||
}
|
||||
|
||||
export interface MappedPosition extends Position {
|
||||
source: string;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
export interface MappingItem {
|
||||
source: string;
|
||||
generatedLine: number;
|
||||
generatedColumn: number;
|
||||
originalLine: number;
|
||||
originalColumn: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export class SourceMapConsumer {
|
||||
static GENERATED_ORDER: number;
|
||||
static ORIGINAL_ORDER: number;
|
||||
|
||||
static GREATEST_LOWER_BOUND: number;
|
||||
static LEAST_UPPER_BOUND: number;
|
||||
|
||||
constructor(rawSourceMap: RawSourceMap);
|
||||
computeColumnSpans(): void;
|
||||
originalPositionFor(generatedPosition: FindPosition): MappedPosition;
|
||||
generatedPositionFor(originalPosition: SourceFindPosition): LineRange;
|
||||
allGeneratedPositionsFor(originalPosition: MappedPosition): Position[];
|
||||
hasContentsOfAllSources(): boolean;
|
||||
sourceContentFor(source: string, returnNullOnMissing?: boolean): string;
|
||||
eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void;
|
||||
}
|
||||
|
||||
export interface Mapping {
|
||||
generated: Position;
|
||||
original: Position;
|
||||
source: string;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
export class SourceMapGenerator {
|
||||
constructor(startOfSourceMap?: StartOfSourceMap);
|
||||
static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator;
|
||||
addMapping(mapping: Mapping): void;
|
||||
setSourceContent(sourceFile: string, sourceContent: string): void;
|
||||
applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export interface CodeWithSourceMap {
|
||||
code: string;
|
||||
map: SourceMapGenerator;
|
||||
}
|
||||
|
||||
export class SourceNode {
|
||||
constructor();
|
||||
constructor(line: number, column: number, source: string);
|
||||
constructor(line: number, column: number, source: string, chunk?: string, name?: string);
|
||||
static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode;
|
||||
add(chunk: string): void;
|
||||
prepend(chunk: string): void;
|
||||
setSourceContent(sourceFile: string, sourceContent: string): void;
|
||||
walk(fn: (chunk: string, mapping: MappedPosition) => void): void;
|
||||
walkSourceContents(fn: (file: string, content: string) => void): void;
|
||||
join(sep: string): SourceNode;
|
||||
replaceRight(pattern: string, replacement: string): SourceNode;
|
||||
toString(): string;
|
||||
toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap;
|
||||
}
|
||||
8
receipeServer/frontend_old/node_modules/terser-webpack-plugin/node_modules/source-map/source-map.js
generated
vendored
Normal file
8
receipeServer/frontend_old/node_modules/terser-webpack-plugin/node_modules/source-map/source-map.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
* Copyright 2009-2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE.txt or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
exports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator;
|
||||
exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;
|
||||
exports.SourceNode = require('./lib/source-node').SourceNode;
|
||||
114
receipeServer/frontend_old/node_modules/terser-webpack-plugin/package.json
generated
vendored
Normal file
114
receipeServer/frontend_old/node_modules/terser-webpack-plugin/package.json
generated
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
{
|
||||
"name": "terser-webpack-plugin",
|
||||
"version": "5.3.1",
|
||||
"description": "Terser plugin for webpack",
|
||||
"license": "MIT",
|
||||
"repository": "webpack-contrib/terser-webpack-plugin",
|
||||
"author": "webpack Contrib Team",
|
||||
"homepage": "https://github.com/webpack-contrib/terser-webpack-plugin",
|
||||
"bugs": "https://github.com/webpack-contrib/terser-webpack-plugin/issues",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/webpack"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
"types": "types/index.d.ts",
|
||||
"engines": {
|
||||
"node": ">= 10.13.0"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "del-cli dist types",
|
||||
"prebuild": "npm run clean",
|
||||
"build:types": "tsc --declaration --emitDeclarationOnly --outDir types && prettier \"types/**/*.ts\" --write",
|
||||
"build:code": "cross-env NODE_ENV=production babel src -d dist --copy-files",
|
||||
"build": "npm-run-all -p \"build:**\"",
|
||||
"commitlint": "commitlint --from=master",
|
||||
"security": "npm audit --production",
|
||||
"lint:prettier": "prettier --list-different .",
|
||||
"lint:js": "eslint --cache .",
|
||||
"lint:types": "tsc --pretty --noEmit",
|
||||
"lint": "npm-run-all -l -p \"lint:**\"",
|
||||
"test:only": "cross-env NODE_ENV=test jest",
|
||||
"test:watch": "npm run test:only -- --watch",
|
||||
"test:coverage": "npm run test:only -- --collectCoverageFrom=\"src/**/*.js\" --coverage",
|
||||
"pretest": "npm run lint",
|
||||
"test": "npm run test:coverage",
|
||||
"prepare": "husky install && npm run build",
|
||||
"release": "standard-version"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"types"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"webpack": "^5.1.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@swc/core": {
|
||||
"optional": true
|
||||
},
|
||||
"uglify-js": {
|
||||
"optional": true
|
||||
},
|
||||
"esbuild": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"jest-worker": "^27.4.5",
|
||||
"schema-utils": "^3.1.1",
|
||||
"serialize-javascript": "^6.0.0",
|
||||
"source-map": "^0.6.1",
|
||||
"terser": "^5.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.16.7",
|
||||
"@babel/core": "^7.16.7",
|
||||
"@babel/preset-env": "^7.16.7",
|
||||
"@commitlint/cli": "^15.0.0",
|
||||
"@commitlint/config-conventional": "^15.0.0",
|
||||
"@swc/core": "^1.2.126",
|
||||
"@types/serialize-javascript": "^5.0.2",
|
||||
"@types/uglify-js": "^3.13.1",
|
||||
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
|
||||
"babel-jest": "^27.4.5",
|
||||
"copy-webpack-plugin": "^9.0.1",
|
||||
"cross-env": "^7.0.3",
|
||||
"del": "^6.0.0",
|
||||
"del-cli": "^3.0.1",
|
||||
"esbuild": "^0.14.10",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-import": "^2.25.4",
|
||||
"file-loader": "^6.2.0",
|
||||
"husky": "^7.0.2",
|
||||
"jest": "^27.4.5",
|
||||
"lint-staged": "^11.0.1",
|
||||
"memfs": "^3.4.1",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.3.2",
|
||||
"standard-version": "^9.3.1",
|
||||
"typescript": "^4.5.4",
|
||||
"uglify-js": "^3.14.5",
|
||||
"webpack": "^5.48.0",
|
||||
"webpack-cli": "^4.9.1",
|
||||
"worker-loader": "^3.0.8"
|
||||
},
|
||||
"keywords": [
|
||||
"uglify",
|
||||
"uglify-js",
|
||||
"uglify-es",
|
||||
"terser",
|
||||
"webpack",
|
||||
"webpack-plugin",
|
||||
"minification",
|
||||
"compress",
|
||||
"compressor",
|
||||
"min",
|
||||
"minification",
|
||||
"minifier",
|
||||
"minify",
|
||||
"optimize",
|
||||
"optimizer"
|
||||
]
|
||||
}
|
||||
329
receipeServer/frontend_old/node_modules/terser-webpack-plugin/types/index.d.ts
generated
vendored
Normal file
329
receipeServer/frontend_old/node_modules/terser-webpack-plugin/types/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,329 @@
|
||||
export = TerserPlugin;
|
||||
/** @typedef {import("schema-utils/declarations/validate").Schema} Schema */
|
||||
/** @typedef {import("webpack").Compiler} Compiler */
|
||||
/** @typedef {import("webpack").Compilation} Compilation */
|
||||
/** @typedef {import("webpack").WebpackError} WebpackError */
|
||||
/** @typedef {import("webpack").Asset} Asset */
|
||||
/** @typedef {import("./utils.js").TerserECMA} TerserECMA */
|
||||
/** @typedef {import("./utils.js").TerserOptions} TerserOptions */
|
||||
/** @typedef {import("jest-worker").Worker} JestWorker */
|
||||
/** @typedef {import("source-map").RawSourceMap} RawSourceMap */
|
||||
/** @typedef {RegExp | string} Rule */
|
||||
/** @typedef {Rule[] | Rule} Rules */
|
||||
/**
|
||||
* @callback ExtractCommentsFunction
|
||||
* @param {any} astNode
|
||||
* @param {{ value: string, type: 'comment1' | 'comment2' | 'comment3' | 'comment4', pos: number, line: number, col: number }} comment
|
||||
* @returns {boolean}
|
||||
*/
|
||||
/**
|
||||
* @typedef {boolean | 'all' | 'some' | RegExp | ExtractCommentsFunction} ExtractCommentsCondition
|
||||
*/
|
||||
/**
|
||||
* @typedef {string | ((fileData: any) => string)} ExtractCommentsFilename
|
||||
*/
|
||||
/**
|
||||
* @typedef {boolean | string | ((commentsFile: string) => string)} ExtractCommentsBanner
|
||||
*/
|
||||
/**
|
||||
* @typedef {Object} ExtractCommentsObject
|
||||
* @property {ExtractCommentsCondition} [condition]
|
||||
* @property {ExtractCommentsFilename} [filename]
|
||||
* @property {ExtractCommentsBanner} [banner]
|
||||
*/
|
||||
/**
|
||||
* @typedef {ExtractCommentsCondition | ExtractCommentsObject} ExtractCommentsOptions
|
||||
*/
|
||||
/**
|
||||
* @typedef {Object} MinimizedResult
|
||||
* @property {string} code
|
||||
* @property {RawSourceMap} [map]
|
||||
* @property {Array<Error | string>} [errors]
|
||||
* @property {Array<Error | string>} [warnings]
|
||||
* @property {Array<string>} [extractedComments]
|
||||
*/
|
||||
/**
|
||||
* @typedef {{ [file: string]: string }} Input
|
||||
*/
|
||||
/**
|
||||
* @typedef {{ [key: string]: any }} CustomOptions
|
||||
*/
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {T extends infer U ? U : CustomOptions} InferDefaultType
|
||||
*/
|
||||
/**
|
||||
* @typedef {Object} PredefinedOptions
|
||||
* @property {boolean} [module]
|
||||
* @property {TerserECMA} [ecma]
|
||||
*/
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {PredefinedOptions & InferDefaultType<T>} MinimizerOptions
|
||||
*/
|
||||
/**
|
||||
* @template T
|
||||
* @callback BasicMinimizerImplementation
|
||||
* @param {Input} input
|
||||
* @param {RawSourceMap | undefined} sourceMap
|
||||
* @param {MinimizerOptions<T>} minifyOptions
|
||||
* @param {ExtractCommentsOptions | undefined} extractComments
|
||||
* @returns {Promise<MinimizedResult>}
|
||||
*/
|
||||
/**
|
||||
* @typedef {object} MinimizeFunctionHelpers
|
||||
* @property {() => string | undefined} [getMinimizerVersion]
|
||||
*/
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {BasicMinimizerImplementation<T> & MinimizeFunctionHelpers} MinimizerImplementation
|
||||
*/
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {Object} InternalOptions
|
||||
* @property {string} name
|
||||
* @property {string} input
|
||||
* @property {RawSourceMap | undefined} inputSourceMap
|
||||
* @property {ExtractCommentsOptions | undefined} extractComments
|
||||
* @property {{ implementation: MinimizerImplementation<T>, options: MinimizerOptions<T> }} minimizer
|
||||
*/
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {JestWorker & { transform: (options: string) => MinimizedResult, minify: (options: InternalOptions<T>) => MinimizedResult }} MinimizerWorker
|
||||
*/
|
||||
/**
|
||||
* @typedef {undefined | boolean | number} Parallel
|
||||
*/
|
||||
/**
|
||||
* @typedef {Object} BasePluginOptions
|
||||
* @property {Rules} [test]
|
||||
* @property {Rules} [include]
|
||||
* @property {Rules} [exclude]
|
||||
* @property {ExtractCommentsOptions} [extractComments]
|
||||
* @property {Parallel} [parallel]
|
||||
*/
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {T extends TerserOptions ? { minify?: MinimizerImplementation<T> | undefined, terserOptions?: MinimizerOptions<T> | undefined } : { minify: MinimizerImplementation<T>, terserOptions?: MinimizerOptions<T> | undefined }} DefinedDefaultMinimizerAndOptions
|
||||
*/
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {BasePluginOptions & { minimizer: { implementation: MinimizerImplementation<T>, options: MinimizerOptions<T> } }} InternalPluginOptions
|
||||
*/
|
||||
/**
|
||||
* @template [T=TerserOptions]
|
||||
*/
|
||||
declare class TerserPlugin<T = import("terser").MinifyOptions> {
|
||||
/**
|
||||
* @private
|
||||
* @param {any} input
|
||||
* @returns {boolean}
|
||||
*/
|
||||
private static isSourceMap;
|
||||
/**
|
||||
* @private
|
||||
* @param {unknown} warning
|
||||
* @param {string} file
|
||||
* @returns {Error}
|
||||
*/
|
||||
private static buildWarning;
|
||||
/**
|
||||
* @private
|
||||
* @param {any} error
|
||||
* @param {string} file
|
||||
* @param {SourceMapConsumer} [sourceMap]
|
||||
* @param {Compilation["requestShortener"]} [requestShortener]
|
||||
* @returns {Error}
|
||||
*/
|
||||
private static buildError;
|
||||
/**
|
||||
* @private
|
||||
* @param {Parallel} parallel
|
||||
* @returns {number}
|
||||
*/
|
||||
private static getAvailableNumberOfCores;
|
||||
/**
|
||||
* @private
|
||||
* @param {any} environment
|
||||
* @returns {TerserECMA}
|
||||
*/
|
||||
private static getEcmaVersion;
|
||||
/**
|
||||
* @param {BasePluginOptions & DefinedDefaultMinimizerAndOptions<T>} [options]
|
||||
*/
|
||||
constructor(
|
||||
options?:
|
||||
| (BasePluginOptions & DefinedDefaultMinimizerAndOptions<T>)
|
||||
| undefined
|
||||
);
|
||||
/**
|
||||
* @private
|
||||
* @type {InternalPluginOptions<T>}
|
||||
*/
|
||||
private options;
|
||||
/**
|
||||
* @private
|
||||
* @param {Compiler} compiler
|
||||
* @param {Compilation} compilation
|
||||
* @param {Record<string, import("webpack").sources.Source>} assets
|
||||
* @param {{availableNumberOfCores: number}} optimizeOptions
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
private optimize;
|
||||
/**
|
||||
* @param {Compiler} compiler
|
||||
* @returns {void}
|
||||
*/
|
||||
apply(compiler: Compiler): void;
|
||||
}
|
||||
declare namespace TerserPlugin {
|
||||
export {
|
||||
terserMinify,
|
||||
uglifyJsMinify,
|
||||
swcMinify,
|
||||
esbuildMinify,
|
||||
Schema,
|
||||
Compiler,
|
||||
Compilation,
|
||||
WebpackError,
|
||||
Asset,
|
||||
TerserECMA,
|
||||
TerserOptions,
|
||||
JestWorker,
|
||||
RawSourceMap,
|
||||
Rule,
|
||||
Rules,
|
||||
ExtractCommentsFunction,
|
||||
ExtractCommentsCondition,
|
||||
ExtractCommentsFilename,
|
||||
ExtractCommentsBanner,
|
||||
ExtractCommentsObject,
|
||||
ExtractCommentsOptions,
|
||||
MinimizedResult,
|
||||
Input,
|
||||
CustomOptions,
|
||||
InferDefaultType,
|
||||
PredefinedOptions,
|
||||
MinimizerOptions,
|
||||
BasicMinimizerImplementation,
|
||||
MinimizeFunctionHelpers,
|
||||
MinimizerImplementation,
|
||||
InternalOptions,
|
||||
MinimizerWorker,
|
||||
Parallel,
|
||||
BasePluginOptions,
|
||||
DefinedDefaultMinimizerAndOptions,
|
||||
InternalPluginOptions,
|
||||
};
|
||||
}
|
||||
type Compiler = import("webpack").Compiler;
|
||||
type BasePluginOptions = {
|
||||
test?: Rules | undefined;
|
||||
include?: Rules | undefined;
|
||||
exclude?: Rules | undefined;
|
||||
extractComments?: ExtractCommentsOptions | undefined;
|
||||
parallel?: Parallel;
|
||||
};
|
||||
type DefinedDefaultMinimizerAndOptions<T> = T extends TerserOptions
|
||||
? {
|
||||
minify?: MinimizerImplementation<T> | undefined;
|
||||
terserOptions?: MinimizerOptions<T> | undefined;
|
||||
}
|
||||
: {
|
||||
minify: MinimizerImplementation<T>;
|
||||
terserOptions?: MinimizerOptions<T> | undefined;
|
||||
};
|
||||
import { terserMinify } from "./utils";
|
||||
import { uglifyJsMinify } from "./utils";
|
||||
import { swcMinify } from "./utils";
|
||||
import { esbuildMinify } from "./utils";
|
||||
type Schema = import("schema-utils/declarations/validate").Schema;
|
||||
type Compilation = import("webpack").Compilation;
|
||||
type WebpackError = import("webpack").WebpackError;
|
||||
type Asset = import("webpack").Asset;
|
||||
type TerserECMA = import("./utils.js").TerserECMA;
|
||||
type TerserOptions = import("./utils.js").TerserOptions;
|
||||
type JestWorker = import("jest-worker").Worker;
|
||||
type RawSourceMap = import("source-map").RawSourceMap;
|
||||
type Rule = RegExp | string;
|
||||
type Rules = Rule[] | Rule;
|
||||
type ExtractCommentsFunction = (
|
||||
astNode: any,
|
||||
comment: {
|
||||
value: string;
|
||||
type: "comment1" | "comment2" | "comment3" | "comment4";
|
||||
pos: number;
|
||||
line: number;
|
||||
col: number;
|
||||
}
|
||||
) => boolean;
|
||||
type ExtractCommentsCondition =
|
||||
| boolean
|
||||
| "all"
|
||||
| "some"
|
||||
| RegExp
|
||||
| ExtractCommentsFunction;
|
||||
type ExtractCommentsFilename = string | ((fileData: any) => string);
|
||||
type ExtractCommentsBanner =
|
||||
| string
|
||||
| boolean
|
||||
| ((commentsFile: string) => string);
|
||||
type ExtractCommentsObject = {
|
||||
condition?: ExtractCommentsCondition | undefined;
|
||||
filename?: ExtractCommentsFilename | undefined;
|
||||
banner?: ExtractCommentsBanner | undefined;
|
||||
};
|
||||
type ExtractCommentsOptions = ExtractCommentsCondition | ExtractCommentsObject;
|
||||
type MinimizedResult = {
|
||||
code: string;
|
||||
map?: import("source-map").RawSourceMap | undefined;
|
||||
errors?: (string | Error)[] | undefined;
|
||||
warnings?: (string | Error)[] | undefined;
|
||||
extractedComments?: string[] | undefined;
|
||||
};
|
||||
type Input = {
|
||||
[file: string]: string;
|
||||
};
|
||||
type CustomOptions = {
|
||||
[key: string]: any;
|
||||
};
|
||||
type InferDefaultType<T> = T extends infer U ? U : CustomOptions;
|
||||
type PredefinedOptions = {
|
||||
module?: boolean | undefined;
|
||||
ecma?: import("terser").ECMA | undefined;
|
||||
};
|
||||
type MinimizerOptions<T> = PredefinedOptions & InferDefaultType<T>;
|
||||
type BasicMinimizerImplementation<T> = (
|
||||
input: Input,
|
||||
sourceMap: RawSourceMap | undefined,
|
||||
minifyOptions: MinimizerOptions<T>,
|
||||
extractComments: ExtractCommentsOptions | undefined
|
||||
) => Promise<MinimizedResult>;
|
||||
type MinimizeFunctionHelpers = {
|
||||
getMinimizerVersion?: (() => string | undefined) | undefined;
|
||||
};
|
||||
type MinimizerImplementation<T> = BasicMinimizerImplementation<T> &
|
||||
MinimizeFunctionHelpers;
|
||||
type InternalOptions<T> = {
|
||||
name: string;
|
||||
input: string;
|
||||
inputSourceMap: RawSourceMap | undefined;
|
||||
extractComments: ExtractCommentsOptions | undefined;
|
||||
minimizer: {
|
||||
implementation: MinimizerImplementation<T>;
|
||||
options: MinimizerOptions<T>;
|
||||
};
|
||||
};
|
||||
type MinimizerWorker<T> = Worker & {
|
||||
transform: (options: string) => MinimizedResult;
|
||||
minify: (options: InternalOptions<T>) => MinimizedResult;
|
||||
};
|
||||
type Parallel = undefined | boolean | number;
|
||||
type InternalPluginOptions<T> = BasePluginOptions & {
|
||||
minimizer: {
|
||||
implementation: MinimizerImplementation<T>;
|
||||
options: MinimizerOptions<T>;
|
||||
};
|
||||
};
|
||||
import { minify } from "./minify";
|
||||
import { Worker } from "jest-worker";
|
||||
17
receipeServer/frontend_old/node_modules/terser-webpack-plugin/types/minify.d.ts
generated
vendored
Normal file
17
receipeServer/frontend_old/node_modules/terser-webpack-plugin/types/minify.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
export type MinimizedResult = import("./index.js").MinimizedResult;
|
||||
export type CustomOptions = import("./index.js").CustomOptions;
|
||||
/** @typedef {import("./index.js").MinimizedResult} MinimizedResult */
|
||||
/** @typedef {import("./index.js").CustomOptions} CustomOptions */
|
||||
/**
|
||||
* @template T
|
||||
* @param {import("./index.js").InternalOptions<T>} options
|
||||
* @returns {Promise<MinimizedResult>}
|
||||
*/
|
||||
export function minify<T>(
|
||||
options: import("./index.js").InternalOptions<T>
|
||||
): Promise<MinimizedResult>;
|
||||
/**
|
||||
* @param {string} options
|
||||
* @returns {Promise<MinimizedResult>}
|
||||
*/
|
||||
export function transform(options: string): Promise<MinimizedResult>;
|
||||
100
receipeServer/frontend_old/node_modules/terser-webpack-plugin/types/utils.d.ts
generated
vendored
Normal file
100
receipeServer/frontend_old/node_modules/terser-webpack-plugin/types/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
export type Task<T> = () => Promise<T>;
|
||||
export type RawSourceMap = import("source-map").RawSourceMap;
|
||||
export type TerserFormatOptions = import("terser").FormatOptions;
|
||||
export type TerserOptions = import("terser").MinifyOptions;
|
||||
export type TerserECMA = import("terser").ECMA;
|
||||
export type ExtractCommentsOptions =
|
||||
import("./index.js").ExtractCommentsOptions;
|
||||
export type ExtractCommentsFunction =
|
||||
import("./index.js").ExtractCommentsFunction;
|
||||
export type ExtractCommentsCondition =
|
||||
import("./index.js").ExtractCommentsCondition;
|
||||
export type Input = import("./index.js").Input;
|
||||
export type MinimizedResult = import("./index.js").MinimizedResult;
|
||||
export type PredefinedOptions = import("./index.js").PredefinedOptions;
|
||||
export type CustomOptions = import("./index.js").CustomOptions;
|
||||
export type ExtractedComments = Array<string>;
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {() => Promise<T>} Task
|
||||
*/
|
||||
/**
|
||||
* Run tasks with limited concurency.
|
||||
* @template T
|
||||
* @param {number} limit - Limit of tasks that run at once.
|
||||
* @param {Task<T>[]} tasks - List of tasks to run.
|
||||
* @returns {Promise<T[]>} A promise that fulfills to an array of the results
|
||||
*/
|
||||
export function throttleAll<T>(limit: number, tasks: Task<T>[]): Promise<T[]>;
|
||||
/**
|
||||
* @param {Input} input
|
||||
* @param {RawSourceMap | undefined} sourceMap
|
||||
* @param {PredefinedOptions & CustomOptions} minimizerOptions
|
||||
* @param {ExtractCommentsOptions | undefined} extractComments
|
||||
* @return {Promise<MinimizedResult>}
|
||||
*/
|
||||
export function terserMinify(
|
||||
input: Input,
|
||||
sourceMap: RawSourceMap | undefined,
|
||||
minimizerOptions: PredefinedOptions & CustomOptions,
|
||||
extractComments: ExtractCommentsOptions | undefined
|
||||
): Promise<MinimizedResult>;
|
||||
export namespace terserMinify {
|
||||
/**
|
||||
* @returns {string | undefined}
|
||||
*/
|
||||
function getMinimizerVersion(): string | undefined;
|
||||
}
|
||||
/**
|
||||
* @param {Input} input
|
||||
* @param {RawSourceMap | undefined} sourceMap
|
||||
* @param {PredefinedOptions & CustomOptions} minimizerOptions
|
||||
* @param {ExtractCommentsOptions | undefined} extractComments
|
||||
* @return {Promise<MinimizedResult>}
|
||||
*/
|
||||
export function uglifyJsMinify(
|
||||
input: Input,
|
||||
sourceMap: RawSourceMap | undefined,
|
||||
minimizerOptions: PredefinedOptions & CustomOptions,
|
||||
extractComments: ExtractCommentsOptions | undefined
|
||||
): Promise<MinimizedResult>;
|
||||
export namespace uglifyJsMinify {
|
||||
/**
|
||||
* @returns {string | undefined}
|
||||
*/
|
||||
function getMinimizerVersion(): string | undefined;
|
||||
}
|
||||
/**
|
||||
* @param {Input} input
|
||||
* @param {RawSourceMap | undefined} sourceMap
|
||||
* @param {PredefinedOptions & CustomOptions} minimizerOptions
|
||||
* @return {Promise<MinimizedResult>}
|
||||
*/
|
||||
export function swcMinify(
|
||||
input: Input,
|
||||
sourceMap: RawSourceMap | undefined,
|
||||
minimizerOptions: PredefinedOptions & CustomOptions
|
||||
): Promise<MinimizedResult>;
|
||||
export namespace swcMinify {
|
||||
/**
|
||||
* @returns {string | undefined}
|
||||
*/
|
||||
function getMinimizerVersion(): string | undefined;
|
||||
}
|
||||
/**
|
||||
* @param {Input} input
|
||||
* @param {RawSourceMap | undefined} sourceMap
|
||||
* @param {PredefinedOptions & CustomOptions} minimizerOptions
|
||||
* @return {Promise<MinimizedResult>}
|
||||
*/
|
||||
export function esbuildMinify(
|
||||
input: Input,
|
||||
sourceMap: RawSourceMap | undefined,
|
||||
minimizerOptions: PredefinedOptions & CustomOptions
|
||||
): Promise<MinimizedResult>;
|
||||
export namespace esbuildMinify {
|
||||
/**
|
||||
* @returns {string | undefined}
|
||||
*/
|
||||
function getMinimizerVersion(): string | undefined;
|
||||
}
|
||||
Reference in New Issue
Block a user