Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/example-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"cpy-cli": "^7.0.0",
"rimraf": "^6.0.1",
"typescript": "~7.0.2",
"vite": "^7.1.9",
"vite": "^8.0.0",
"vitest": "^4.1.0",
"xsea": "^0.1.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/example-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"cpy-cli": "^7.0.0",
"rimraf": "^6.0.1",
"typescript": "~7.0.2",
"vite": "^7.1.9",
"vite": "^8.0.0",
"vitest": "^4.1.0"
},
"engines": {
Expand Down
1 change: 1 addition & 0 deletions packages/sea-builder/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ project adheres to
dropping Node.js 20, Node.js 22 below 22.23.1, Node.js 24 below
24.2.0, and every Node.js 25 release; bumped pnpm to v11 (#88).
- Bumped the `typescript` devDependency to `~6.0.3` (#113).
- Bumped the `vite` devDependency to `^8.0.0` (#121).

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion packages/sea-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"rimraf": "^6.0.1",
"type-fest": "^5.0.1",
"typescript": "~7.0.2",
"vite": "^7.1.9",
"vite": "^8.0.0",
"vitest": "^4.1.0"
},
"peerDependencies": {
Expand Down
11 changes: 11 additions & 0 deletions packages/vite-lib-config/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ project adheres to
emit syntax unsupported on Node.js 20, even when the build itself
runs on a supported Node.js version (#88).
- Bumped the `typescript` devDependency to `~6.0.3` (#113).
- **Breaking:** bumped the `vite` dependency from `^7.1.9` to
`^8.0.0`, and `vite-plugin-dts` from `^4.5.4` to `^5.0.1`. Renamed
`build.rollupOptions` to `build.rolldownOptions` in the shared
`viteConfig`, matching Vite 8's Rolldown-based bundler, and removed
the `output.importAttributesKey` option that used to live under the
old `build.rollupOptions` — Rolldown's `OutputOptions` has no
equivalent under the new `build.rolldownOptions` either, so
downstream consumers of the published `viteConfig()` that relied on
it to control emitted import-attribute syntax (the
`with { type: ... }` / `assert { type: ... }` forms) must drop that
reliance (#121).

### Fixed

Expand Down
4 changes: 2 additions & 2 deletions packages/vite-lib-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"lodash-es": "^4.17.21",
"shebang-regex": "^4.0.0",
"type-fest": "^5.0.1",
"vite": "^7.1.9",
"vite-plugin-dts": "^4.5.4"
"vite": "^8.0.0",
"vite-plugin-dts": "^5.0.1"
},
"devDependencies": {
"@kurone-kito/typescript-config": "workspace:^",
Expand Down
5 changes: 2 additions & 3 deletions packages/vite-lib-config/src/vite.mts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@ const out = '[name].mjs';
/** Static configuration for Vite builds. */
const staticConfig = {
build: {
rollupOptions: {
rolldownOptions: {
output: {
chunkFileNames: out,
entryFileNames: out,
format: 'es',
importAttributesKey: 'with',
},
},
sourcemap: true,
Expand Down Expand Up @@ -74,7 +73,7 @@ const innerCreateConfig = (entries: readonly string[]): UserConfig => {
const bin = entry.every((f) => shebangRegex.test(readFileSync(f, 'utf8')));
return mergeConfig<UserConfig, UserConfig>(staticConfig, {
build: {
rollupOptions: { input: entry },
rolldownOptions: { input: entry },
...(bin ? {} : { lib: { entry, formats: ['es'] } }),
},
plugins: bin ? [] : [dts({ exclude: ['**/*.spec.mts'] })],
Expand Down
26 changes: 25 additions & 1 deletion packages/vite-lib-config/src/vite.spec.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises';
import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
import { viteConfig } from './vite.mjs';

Expand Down Expand Up @@ -141,3 +142,26 @@ describe('viteConfig', () => {
describe('srcDir', () => {
it('exports srcDir constant', () => expect(srcDir).toBe('src'));
});

describe('build configuration source', () => {
// Vite's own `mergeConfig` bidirectionally aliases `build.rollupOptions`
// and `build.rolldownOptions` in its merged output (confirmed
// empirically), so a runtime-output assertion cannot distinguish which
// key this file declares -- both keys read back identically either way.
// Guard against reverting the rename by asserting on the source text
// itself instead.
it('declares build.rolldownOptions and drops importAttributesKey', async () => {
const source = await readFile(
fileURLToPath(new URL('./vite.mts', import.meta.url)),
'utf8',
);
// Match the actual declaration shapes (staticConfig's `output` nesting
// and innerCreateConfig's `input: entry` override), not a bare
// substring -- a substring or property-key-only match could still
// pass from an inert comment mentioning the key name.
expect(source).toMatch(/rolldownOptions:\s*\{\s*output:/);
expect(source).toMatch(/rolldownOptions:\s*\{\s*input:\s*entry\s*\}/);
expect(source).not.toContain('rollupOptions:');
expect(source).not.toContain('importAttributesKey:');
});
});
Loading
Loading