prebundle 1.2.5 → 1.3.0-beta.0

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/dist/index.js +4 -4
  2. package/package.json +11 -14
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import * as __WEBPACK_EXTERNAL_MODULE__compiled_fast_glob_index_js__ from "../co
7
7
  import * as __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__ from "../compiled/rslog/index.js";
8
8
  import * as __WEBPACK_EXTERNAL_MODULE_rollup_plugin_dts__ from "rollup-plugin-dts";
9
9
  import * as __WEBPACK_EXTERNAL_MODULE_rollup__ from "rollup";
10
- import * as __WEBPACK_EXTERNAL_MODULE_terser__ from "terser";
10
+ import * as __WEBPACK_EXTERNAL_MODULE__swc_core__ from "@swc/core";
11
11
  import * as __WEBPACK_EXTERNAL_MODULE_prettier__ from "prettier";
12
12
  const DIST_DIR = 'compiled';
13
13
  const DEFAULT_EXTERNALS = {
@@ -181,12 +181,12 @@ async function emitIndex(code, distPath, prettier) {
181
181
  const distIndex = (0, __WEBPACK_EXTERNAL_MODULE_node_path__.join)(distPath, 'index.js');
182
182
  // use terser to strip comments and use prettier to format the code
183
183
  if (prettier) {
184
- const minimized = await (0, __WEBPACK_EXTERNAL_MODULE_terser__.minify)(code, {
184
+ const minimized = await (0, __WEBPACK_EXTERNAL_MODULE__swc_core__.minify)(code, {
185
185
  compress: false,
186
186
  mangle: false,
187
- ecma: 2019
187
+ ecma: 2021
188
188
  });
189
- if (!minimized.code) throw new Error('terser minify failed');
189
+ if (!minimized.code) throw new Error('SWC minify failed');
190
190
  const formatted = await (0, __WEBPACK_EXTERNAL_MODULE_prettier__.format)(minimized.code, {
191
191
  filepath: distIndex
192
192
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prebundle",
3
- "version": "1.2.5",
3
+ "version": "1.3.0-beta.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/rspack-contrib/prebundle"
@@ -15,19 +15,12 @@
15
15
  "bin.js",
16
16
  "compiled"
17
17
  ],
18
- "scripts": {
19
- "build": "rslib build",
20
- "dev": "rslib build --watch",
21
- "prebundle": "node ./bin.js",
22
- "prepare": "npm run build",
23
- "bump": "npx bumpp"
24
- },
25
18
  "dependencies": {
19
+ "@swc/core": "^1.9.2",
26
20
  "@vercel/ncc": "0.38.1",
27
21
  "prettier": "^3.2.5",
28
22
  "rollup": "^4.17.1",
29
- "rollup-plugin-dts": "^6.1.0",
30
- "terser": "^5.31.2"
23
+ "rollup-plugin-dts": "^6.1.0"
31
24
  },
32
25
  "devDependencies": {
33
26
  "@rslib/core": "0.0.11",
@@ -38,10 +31,14 @@
38
31
  "rslog": "^1.2.2",
39
32
  "typescript": "^5.4.2"
40
33
  },
41
- "packageManager": "pnpm@9.0.5",
42
34
  "publishConfig": {
43
35
  "access": "public",
44
- "registry": "https://registry.npmjs.org/",
45
- "provenance": true
36
+ "registry": "https://registry.npmjs.org/"
37
+ },
38
+ "scripts": {
39
+ "build": "rslib build",
40
+ "dev": "rslib build --watch",
41
+ "prebundle": "node ./bin.js",
42
+ "bump": "npx bumpp"
46
43
  }
47
- }
44
+ }