js-shrink 1.0.16 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/JsShrink.js +12 -0
  2. package/package.json +22 -22
package/JsShrink.js CHANGED
@@ -4135,6 +4135,18 @@ function Shrink(src, options) {
4135
4135
  update(`${propertySrc}:${node._v}`, node)
4136
4136
  }
4137
4137
  }
4138
+ else if (node.parent.type === "ImportSpecifier" && node.parent.local === node && node.parent.imported?.start === node.start
4139
+ || node.parent.type === "ExportSpecifier" && node.parent.local === node && node.parent.exported?.start === node.start
4140
+ ) {
4141
+ if (node.name !== node._v) {
4142
+ if (node.parent.type === "ImportSpecifier") {
4143
+ update(`${node.name} as ${node._v}`, node)
4144
+ }
4145
+ else {
4146
+ update(`${node._v} as ${node.name}`, node)
4147
+ }
4148
+ }
4149
+ }
4138
4150
  else{
4139
4151
  update(node._v, node)
4140
4152
  }
package/package.json CHANGED
@@ -1,24 +1,24 @@
1
1
  {
2
- "name": "js-shrink",
3
- "version": "1.0.16",
4
- "description": "Supplemental javascript minifier",
5
- "repository": "https://github.com/brandon942/js-shrink",
6
- "author": "brandon942",
7
- "license": "MIT",
8
- "main": "JsShrink.js",
9
- "scripts": {},
10
- "files": [
11
- "README.md",
12
- "LICENSE",
13
- "JsShrink.js",
14
- "scope-analyzer.js",
15
- "transform-ast.js"
16
- ],
17
- "dependencies": {
18
- "acorn": "^8.14.1",
19
- "transform-ast": "^2.4.4",
20
- "magic-string": "^0.30.21",
21
- "convert-source-map": "^2.0.0",
22
- "merge-source-map": "^1.1.0"
23
- }
2
+ "name": "js-shrink",
3
+ "version": "1.0.17",
4
+ "description": "Supplemental javascript minifier",
5
+ "repository": "https://github.com/brandon942/js-shrink",
6
+ "author": "brandon942",
7
+ "license": "MIT",
8
+ "main": "JsShrink.js",
9
+ "scripts": {},
10
+ "files": [
11
+ "README.md",
12
+ "LICENSE",
13
+ "JsShrink.js",
14
+ "scope-analyzer.js",
15
+ "transform-ast.js"
16
+ ],
17
+ "dependencies": {
18
+ "acorn": "^8.14.1",
19
+ "transform-ast": "^2.4.4",
20
+ "magic-string": "^0.30.21",
21
+ "convert-source-map": "^2.0.0",
22
+ "merge-source-map": "^1.1.0"
23
+ }
24
24
  }