Skip to content

Commit 0436e06

Browse files
committed
fix: remove legacy import assertion unsupported by Node v22
1 parent 074f9f7 commit 0436e06

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

.github/workflows/test.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: Unit tests
2-
on: pull_request
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
39

410
jobs:
511
test:
@@ -16,6 +22,7 @@ jobs:
1622
- uses: pnpm/action-setup@v4.0.0
1723
- uses: actions/setup-node@v4
1824
with:
25+
node-version: ${{ matrix.node-version }}
1926
cache: 'pnpm'
2027
- name: Install dependencies
2128
run: pnpm install

packages/core/rollup.config.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import typescript from '@rollup/plugin-typescript'
2-
import pkg from './package.json' assert { type: 'json' }
3-
import { builtinModules as builtins } from 'module'
2+
import * as fs from 'node:fs/promises'
3+
import * as path from 'node:path'
4+
import { builtinModules as builtins } from 'node:module'
5+
import { fileURLToPath } from 'node:url'
6+
7+
const pkg = JSON.parse(await fs.readFile(path.join(fileURLToPath(import.meta.url), '..', 'package.json')))
48

59
const deps = Object.keys(pkg.dependencies || {})
610

packages/vite/rollup.config.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import typescript from '@rollup/plugin-typescript'
2-
import pkg from './package.json' assert { type: 'json' }
3-
import { builtinModules as builtins } from 'module'
2+
import * as fs from 'node:fs/promises'
3+
import * as path from 'node:path'
4+
import { builtinModules as builtins } from 'node:module'
5+
import { fileURLToPath } from 'node:url'
46

7+
const pkg = JSON.parse(await fs.readFile(path.join(fileURLToPath(import.meta.url), '..', 'package.json')))
58
const deps = Object.keys(pkg.dependencies || {})
69

710
export default {

0 commit comments

Comments
 (0)