From 5afedf83c96eff47a22c93b2ca98d8a5bc72f0ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= <kdy1997.dev@gmail.com> Date: Sat, 23 Oct 2021 22:18:14 +0900 Subject: [PATCH] fix(bundler): Fix name of helper (#2518) swc_bundler: - Use correct name for helpers. (#2517) --- bundler/Cargo.toml | 2 +- bundler/src/bundler/helpers/_require.js | 2 +- .../fixture/issue-2124/named-export/output/entry.inlined.ts | 2 +- bundler/tests/fixture/issue-2124/named-export/output/entry.ts | 2 +- .../fixture/issue-2124/namespace-export/output/entry.inlined.ts | 2 +- .../tests/fixture/issue-2124/namespace-export/output/entry.ts | 2 +- node/bundler/tests/pass/cjs/common-library/output/entry.js | 2 +- node/bundler/tests/pass/cjs/conditional/output/entry.js | 2 +- .../pass/cjs/issue-967-no-recursive-require/output/entry.js | 2 +- .../tests/pass/cjs/issue-967-recursive-require/output/entry.js | 2 +- node/bundler/tests/pass/cjs/mixed/output/entry.js | 2 +- node/bundler/tests/pass/cjs/nested/output/entry.js | 2 +- node/bundler/tests/pass/issue-1225/cjs/output/entry.js | 2 +- node/bundler/tests/pass/issue-1225/esm/output/entry.js | 2 +- node/bundler/tests/pass/issue-1328/case1/output/entry.js | 2 +- node/bundler/tests/pass/issue-2124/named-export/output/entry.js | 2 +- .../tests/pass/node-modules/library/simple/output/entry.js | 2 +- node/bundler/tests/pass/resolve-name-fix/output/entry.js | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/bundler/Cargo.toml b/bundler/Cargo.toml index 9b081086c376..d93503d88ecb 100644 --- a/bundler/Cargo.toml +++ b/bundler/Cargo.toml @@ -9,7 +9,7 @@ include = ["Cargo.toml", "build.rs", "src/**/*.rs", "src/**/*.js"] license = "Apache-2.0/MIT" name = "swc_bundler" repository = "https://github.com/swc-project/swc.git" -version = "0.75.1" +version = "0.75.2" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] diff --git a/bundler/src/bundler/helpers/_require.js b/bundler/src/bundler/helpers/_require.js index d89d87b6f1cb..3275fe91905a 100644 --- a/bundler/src/bundler/helpers/_require.js +++ b/bundler/src/bundler/helpers/_require.js @@ -1,4 +1,4 @@ -function __spack_require__(mod) { +function __swcpack_require__(mod) { var cache; if (cache) { diff --git a/bundler/tests/fixture/issue-2124/named-export/output/entry.inlined.ts b/bundler/tests/fixture/issue-2124/named-export/output/entry.inlined.ts index 6cc73c56bc6f..8a29fa02418f 100644 --- a/bundler/tests/fixture/issue-2124/named-export/output/entry.inlined.ts +++ b/bundler/tests/fixture/issue-2124/named-export/output/entry.inlined.ts @@ -1,4 +1,4 @@ -function __spack_require__(mod) { +function __swcpack_require__(mod) { var cache; if (cache) { return cache; diff --git a/bundler/tests/fixture/issue-2124/named-export/output/entry.ts b/bundler/tests/fixture/issue-2124/named-export/output/entry.ts index 6cc73c56bc6f..8a29fa02418f 100644 --- a/bundler/tests/fixture/issue-2124/named-export/output/entry.ts +++ b/bundler/tests/fixture/issue-2124/named-export/output/entry.ts @@ -1,4 +1,4 @@ -function __spack_require__(mod) { +function __swcpack_require__(mod) { var cache; if (cache) { return cache; diff --git a/bundler/tests/fixture/issue-2124/namespace-export/output/entry.inlined.ts b/bundler/tests/fixture/issue-2124/namespace-export/output/entry.inlined.ts index 2af5242427c9..824d71ebdf37 100644 --- a/bundler/tests/fixture/issue-2124/namespace-export/output/entry.inlined.ts +++ b/bundler/tests/fixture/issue-2124/namespace-export/output/entry.inlined.ts @@ -1,4 +1,4 @@ -function __spack_require__(mod) { +function __swcpack_require__(mod) { var cache; if (cache) { return cache; diff --git a/bundler/tests/fixture/issue-2124/namespace-export/output/entry.ts b/bundler/tests/fixture/issue-2124/namespace-export/output/entry.ts index 88220388abaa..98f42e70b254 100644 --- a/bundler/tests/fixture/issue-2124/namespace-export/output/entry.ts +++ b/bundler/tests/fixture/issue-2124/namespace-export/output/entry.ts @@ -1,4 +1,4 @@ -function __spack_require__(mod) { +function __swcpack_require__(mod) { var cache; if (cache) { return cache; diff --git a/node/bundler/tests/pass/cjs/common-library/output/entry.js b/node/bundler/tests/pass/cjs/common-library/output/entry.js index c5e74ee6e91b..4fb043bf96ea 100644 --- a/node/bundler/tests/pass/cjs/common-library/output/entry.js +++ b/node/bundler/tests/pass/cjs/common-library/output/entry.js @@ -1,4 +1,4 @@ -function __spack_require__(mod) { +function __swcpack_require__(mod) { var cache; if (cache) { return cache; diff --git a/node/bundler/tests/pass/cjs/conditional/output/entry.js b/node/bundler/tests/pass/cjs/conditional/output/entry.js index 8bcd05c458ff..bd96084bb6d9 100644 --- a/node/bundler/tests/pass/cjs/conditional/output/entry.js +++ b/node/bundler/tests/pass/cjs/conditional/output/entry.js @@ -1,4 +1,4 @@ -function __spack_require__(mod) { +function __swcpack_require__(mod) { var cache; if (cache) { return cache; diff --git a/node/bundler/tests/pass/cjs/issue-967-no-recursive-require/output/entry.js b/node/bundler/tests/pass/cjs/issue-967-no-recursive-require/output/entry.js index 5e2f431b2b85..ada69cad2849 100644 --- a/node/bundler/tests/pass/cjs/issue-967-no-recursive-require/output/entry.js +++ b/node/bundler/tests/pass/cjs/issue-967-no-recursive-require/output/entry.js @@ -1,4 +1,4 @@ -function __spack_require__(mod) { +function __swcpack_require__(mod) { var cache; if (cache) { return cache; diff --git a/node/bundler/tests/pass/cjs/issue-967-recursive-require/output/entry.js b/node/bundler/tests/pass/cjs/issue-967-recursive-require/output/entry.js index 6fe14a695470..7dd35b6cc4d5 100644 --- a/node/bundler/tests/pass/cjs/issue-967-recursive-require/output/entry.js +++ b/node/bundler/tests/pass/cjs/issue-967-recursive-require/output/entry.js @@ -1,4 +1,4 @@ -function __spack_require__(mod) { +function __swcpack_require__(mod) { var cache; if (cache) { return cache; diff --git a/node/bundler/tests/pass/cjs/mixed/output/entry.js b/node/bundler/tests/pass/cjs/mixed/output/entry.js index b501c82924ce..95abc942a6b6 100644 --- a/node/bundler/tests/pass/cjs/mixed/output/entry.js +++ b/node/bundler/tests/pass/cjs/mixed/output/entry.js @@ -1,4 +1,4 @@ -function __spack_require__(mod) { +function __swcpack_require__(mod) { var cache; if (cache) { return cache; diff --git a/node/bundler/tests/pass/cjs/nested/output/entry.js b/node/bundler/tests/pass/cjs/nested/output/entry.js index 9cb629a871f9..7335e43ca528 100644 --- a/node/bundler/tests/pass/cjs/nested/output/entry.js +++ b/node/bundler/tests/pass/cjs/nested/output/entry.js @@ -1,4 +1,4 @@ -function __spack_require__(mod) { +function __swcpack_require__(mod) { var cache; if (cache) { return cache; diff --git a/node/bundler/tests/pass/issue-1225/cjs/output/entry.js b/node/bundler/tests/pass/issue-1225/cjs/output/entry.js index 09a155c81959..3237c0688c8a 100644 --- a/node/bundler/tests/pass/issue-1225/cjs/output/entry.js +++ b/node/bundler/tests/pass/issue-1225/cjs/output/entry.js @@ -1,4 +1,4 @@ -function __spack_require__(mod) { +function __swcpack_require__(mod) { var cache; if (cache) { return cache; diff --git a/node/bundler/tests/pass/issue-1225/esm/output/entry.js b/node/bundler/tests/pass/issue-1225/esm/output/entry.js index c3d2df7b4b0c..87b84a5c49b5 100644 --- a/node/bundler/tests/pass/issue-1225/esm/output/entry.js +++ b/node/bundler/tests/pass/issue-1225/esm/output/entry.js @@ -1,4 +1,4 @@ -function __spack_require__(mod) { +function __swcpack_require__(mod) { var cache; if (cache) { return cache; diff --git a/node/bundler/tests/pass/issue-1328/case1/output/entry.js b/node/bundler/tests/pass/issue-1328/case1/output/entry.js index 6f6e74569099..70a78a3b89ab 100644 --- a/node/bundler/tests/pass/issue-1328/case1/output/entry.js +++ b/node/bundler/tests/pass/issue-1328/case1/output/entry.js @@ -1,4 +1,4 @@ -function __spack_require__(mod) { +function __swcpack_require__(mod) { var cache; if (cache) { return cache; diff --git a/node/bundler/tests/pass/issue-2124/named-export/output/entry.js b/node/bundler/tests/pass/issue-2124/named-export/output/entry.js index 0e2bb593c08f..f196d3de7d14 100644 --- a/node/bundler/tests/pass/issue-2124/named-export/output/entry.js +++ b/node/bundler/tests/pass/issue-2124/named-export/output/entry.js @@ -1,4 +1,4 @@ -function __spack_require__(mod) { +function __swcpack_require__(mod) { var cache; if (cache) { return cache; diff --git a/node/bundler/tests/pass/node-modules/library/simple/output/entry.js b/node/bundler/tests/pass/node-modules/library/simple/output/entry.js index c79a420dd139..7f335253ffeb 100644 --- a/node/bundler/tests/pass/node-modules/library/simple/output/entry.js +++ b/node/bundler/tests/pass/node-modules/library/simple/output/entry.js @@ -1,4 +1,4 @@ -function __spack_require__(mod) { +function __swcpack_require__(mod) { var cache; if (cache) { return cache; diff --git a/node/bundler/tests/pass/resolve-name-fix/output/entry.js b/node/bundler/tests/pass/resolve-name-fix/output/entry.js index d85e96b3e512..bcb8f565392a 100644 --- a/node/bundler/tests/pass/resolve-name-fix/output/entry.js +++ b/node/bundler/tests/pass/resolve-name-fix/output/entry.js @@ -1,4 +1,4 @@ -function __spack_require__(mod) { +function __swcpack_require__(mod) { var cache; if (cache) { return cache;