summaryrefslogtreecommitdiff
path: root/node_modules/babel-plugin-uglify/dist
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-03-14 17:01:52 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-03-14 17:01:52 +0800
commit7f8f993637e698d63aeb2e08f053e0948d9f4d31 (patch)
tree52d5e508a4ff2e4fa80dde457bc52e662a3887ab /node_modules/babel-plugin-uglify/dist
parent7210ae26624cc6c6ad6725040e388b31991b7907 (diff)
fixed minifier
Diffstat (limited to 'node_modules/babel-plugin-uglify/dist')
-rw-r--r--node_modules/babel-plugin-uglify/dist/index.js55
1 files changed, 0 insertions, 55 deletions
diff --git a/node_modules/babel-plugin-uglify/dist/index.js b/node_modules/babel-plugin-uglify/dist/index.js
deleted file mode 100644
index 9a0b29c6..00000000
--- a/node_modules/babel-plugin-uglify/dist/index.js
+++ /dev/null
@@ -1,55 +0,0 @@
-'use strict';
-
-exports.__esModule = true;
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-var _uglifyJs = require('uglify-js');
-
-var compressor = _uglifyJs.Compressor();
-
-var LocationFixer = (function (_TreeWalker) {
- _inherits(LocationFixer, _TreeWalker);
-
- function LocationFixer(path) {
- _classCallCheck(this, LocationFixer);
-
- _TreeWalker.call(this, function (node) {
- node.start.file = node.end.file = path.hub.file.opts.filenameRelative;
- });
- }
-
- return LocationFixer;
-})(_uglifyJs.TreeWalker);
-
-exports['default'] = function (_ref) {
- var Plugin = _ref.Plugin;
- var t = _ref.types;
- return new Plugin('uglify', {
- visitor: {
- Program: function Program(ast) {
- // Convert to UglifyJS AST
- var uAST = _uglifyJs.AST_Node.from_mozilla_ast(ast);
-
- // Fix locations (Babel doesn't insert `loc.source` into nodes for some reason)
- uAST.walk(new LocationFixer(this));
-
- // Compress
- uAST.figure_out_scope();
- uAST = uAST.transform(compressor);
-
- // Mangle names
- uAST.figure_out_scope();
- uAST.compute_char_frequency();
- uAST.mangle_names();
-
- // Convert back to ESTree AST
- return uAST.to_mozilla_ast();
- }
- }
- });
-};
-
-module.exports = exports['default']; \ No newline at end of file