Skip to content

Commit 58ab29b

Browse files
authored
Merge branch 'vuejs:main' into main
2 parents 18a9fd8 + dadb363 commit 58ab29b

File tree

5 files changed

+156
-53
lines changed

5 files changed

+156
-53
lines changed

.github/workflows/autofix.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ jobs:
1616
- name: Install pnpm
1717
uses: pnpm/[email protected]
1818

19-
- name: Set node version to 18
19+
- name: Install Node.js
2020
uses: actions/setup-node@v4
2121
with:
22-
node-version: 18
23-
cache: pnpm
22+
node-version-file: '.node-version'
23+
registry-url: 'https://registry.npmjs.org'
24+
cache: 'pnpm'
2425

2526
- run: pnpm install
2627

.github/workflows/canary-minor.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
- name: Install pnpm
2020
uses: pnpm/[email protected]
2121

22-
- name: Set node version to 18
22+
- name: Install Node.js
2323
uses: actions/setup-node@v4
2424
with:
25-
node-version: 18
25+
node-version-file: '.node-version'
2626
registry-url: 'https://registry.npmjs.org'
2727
cache: 'pnpm'
2828

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"@rollup/plugin-json": "^6.1.0",
6868
"@rollup/plugin-node-resolve": "^15.2.3",
6969
"@rollup/plugin-replace": "5.0.4",
70-
"@rollup/plugin-terser": "^0.4.4",
70+
"@swc/core": "^1.6.1",
7171
"@types/hash-sum": "^1.0.2",
7272
"@types/minimist": "^1.2.5",
7373
"@types/node": "^20.14.2",

pnpm-lock.yaml

+130-39
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rollup.config.js

+19-8
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import pico from 'picocolors'
99
import commonJS from '@rollup/plugin-commonjs'
1010
import polyfillNode from 'rollup-plugin-polyfill-node'
1111
import { nodeResolve } from '@rollup/plugin-node-resolve'
12-
import terser from '@rollup/plugin-terser'
1312
import esbuild from 'rollup-plugin-esbuild'
1413
import alias from '@rollup/plugin-alias'
1514
import { entries } from './scripts/aliases.js'
1615
import { inlineEnums } from './scripts/inline-enums.js'
16+
import { minify as minifySwc } from '@swc/core'
1717

1818
/**
1919
* @template T
@@ -364,14 +364,25 @@ function createMinifiedConfig(/** @type {PackageFormat} */ format) {
364364
format: outputConfigs[format].format,
365365
},
366366
[
367-
terser({
368-
module: /^esm/.test(format),
369-
compress: {
370-
ecma: 2016,
371-
pure_getters: true,
367+
{
368+
name: 'swc-minify',
369+
370+
async renderChunk(
371+
contents,
372+
_,
373+
{ format, sourcemap, sourcemapExcludeSources },
374+
) {
375+
const { code, map } = await minifySwc(contents, {
376+
module: format === 'es',
377+
compress: true,
378+
mangle: true,
379+
sourceMap: !!sourcemap,
380+
inlineSourcesContent: !sourcemapExcludeSources,
381+
})
382+
383+
return { code, map: map || null }
372384
},
373-
safari10: true,
374-
}),
385+
},
375386
],
376387
)
377388
}

0 commit comments

Comments
 (0)