mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
Use rolldown for bundling (#621)
* Use rolldown for bundling * update vite --------- Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
This commit is contained in:
co-authored by
Mateusz Burzyński
parent
6c80731937
commit
c13a48983a
+3
-9
@@ -5,7 +5,7 @@
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"build": "rolldown -c",
|
||||
"test": "vitest",
|
||||
"test:watch": "pnpm test --watch",
|
||||
"typecheck": "tsc",
|
||||
@@ -38,19 +38,13 @@
|
||||
"@changesets/cli": "^2.29.3",
|
||||
"@changesets/types": "^6.1.0",
|
||||
"@changesets/write": "^0.4.0",
|
||||
"@rollup/plugin-commonjs": "^28.0.3",
|
||||
"@rollup/plugin-json": "^6.1.0",
|
||||
"@rollup/plugin-node-resolve": "^16.0.1",
|
||||
"@rollup/plugin-terser": "^0.4.4",
|
||||
"@types/node": "^24.12.2",
|
||||
"@types/semver": "^7.5.0",
|
||||
"builtin-modules": "^5.0.0",
|
||||
"esbuild": "^0.25.4",
|
||||
"fixturez": "^1.1.0",
|
||||
"oxfmt": "^0.48.0",
|
||||
"rollup": "^4.40.2",
|
||||
"rolldown": "^1.0.1",
|
||||
"typescript": "^5.8.3",
|
||||
"vitest": "^4.1.5"
|
||||
"vitest": "^4.1.6"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=24"
|
||||
|
||||
Generated
+225
-1322
File diff suppressed because it is too large
Load Diff
+11
-3
@@ -1,8 +1,16 @@
|
||||
allowBuilds:
|
||||
esbuild: true
|
||||
|
||||
blockExoticSubdeps: true
|
||||
dedupePeers: true
|
||||
dedupePeerDependents: true
|
||||
minimumReleaseAge: 10080
|
||||
minimumReleaseAgeExclude:
|
||||
- '@oxc-project/*'
|
||||
- '@rolldown/*'
|
||||
- rolldown@1.0.1
|
||||
- vite@8.0.13
|
||||
- vitest@4.1.6
|
||||
|
||||
overrides:
|
||||
lightningcss: '-' # we do not bundle any css
|
||||
postcss: '-' # we do not bundle any css
|
||||
|
||||
trustPolicy: no-downgrade
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { defineConfig } from 'rolldown'
|
||||
|
||||
export default defineConfig({
|
||||
input: 'src/index.ts',
|
||||
output: {
|
||||
dir: 'dist',
|
||||
format: 'esm',
|
||||
cleanDir: true,
|
||||
minify: true,
|
||||
comments: false,
|
||||
},
|
||||
platform: 'node',
|
||||
})
|
||||
@@ -1,38 +0,0 @@
|
||||
import commonjs from "@rollup/plugin-commonjs";
|
||||
import json from "@rollup/plugin-json";
|
||||
import nodeResolve from "@rollup/plugin-node-resolve";
|
||||
import terser from "@rollup/plugin-terser";
|
||||
import builtinModulesList from "builtin-modules";
|
||||
import { transform } from "esbuild";
|
||||
import { defineConfig } from "rollup";
|
||||
|
||||
const builtinModules = new Set(builtinModulesList);
|
||||
|
||||
export default defineConfig({
|
||||
input: "src/index.ts",
|
||||
output: {
|
||||
dir: "dist",
|
||||
format: "esm",
|
||||
},
|
||||
external: (id) => builtinModules.has(id),
|
||||
plugins: [
|
||||
nodeResolve({
|
||||
preferBuiltins: false,
|
||||
}),
|
||||
json(),
|
||||
commonjs(),
|
||||
{
|
||||
name: "esbuild",
|
||||
async transform(code, id) {
|
||||
if (!/\.(mts|cts|ts|tsx)$/.test(id)) {
|
||||
return null;
|
||||
}
|
||||
const result = await transform(code, {
|
||||
loader: "ts",
|
||||
});
|
||||
return result.code;
|
||||
},
|
||||
},
|
||||
terser(),
|
||||
],
|
||||
});
|
||||
Reference in New Issue
Block a user