Skip to content

Commit

Permalink
fix: use moduleResolution 'bundler' instead legacy 'node' (node10) fo…
Browse files Browse the repository at this point in the history
…r correct support of ESM
  • Loading branch information
Powerplex committed Aug 27, 2024
1 parent e5cd123 commit d25e644
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 78 deletions.
2 changes: 1 addition & 1 deletion config/component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { createRequire } from 'node:module'
import { join } from 'node:path'

import terser from '@rollup/plugin-terser'
import react from '@vitejs/plugin-react'
import browserslistToEsbuild from 'browserslist-to-esbuild'
import { terser } from 'rollup-plugin-terser'
import dts from 'vite-plugin-dts'

import sparkDocgen from './plugins/sparkDocgen'
Expand Down
110 changes: 41 additions & 69 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@
"url": "git@github.com:adevinta/spark.git"
},
"dependencies": {
"@rollup/plugin-terser": "^0.4.4",
"@spark-ui/tabs": "^2.0.0",
"@spark-ui/theme-utils": "^4.0.0",
"@storybook/test": "^8.0.2"
},
"devDependencies": {
"@adevinta/tailwind-config-viewer": "3.0.0",
"@axe-core/webdriverjs": "^4.9.1",
"@axe-core/playwright": "^4.9.1",
"@axe-core/webdriverjs": "^4.9.1",
"@babel/core": "7.24.7",
"@commitlint/cli": "17.8.1",
"@commitlint/config-conventional": "17.8.1",
Expand Down Expand Up @@ -120,7 +121,6 @@
"remark-gfm": "^4.0.0",
"resize-observer-polyfill": "^1.5.1",
"rollup": "^3.28.1",
"rollup-plugin-terser": "7.0.2",
"scroll-into-view-if-needed": "^3.0.10",
"selenium-webdriver": "^4.8.1",
"storybook": "^8.0.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default () => `import { terser } from 'rollup-plugin-terser'
export default () => `import terser from '@rollup/plugin-terser'
import dts from 'vite-plugin-dts'
import browserslistToEsbuild from 'browserslist-to-esbuild'
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/internal-utils/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { terser } from 'rollup-plugin-terser'
import terser from '@rollup/plugin-terser'
import dts from 'vite-plugin-dts'
import browserslistToEsbuild from 'browserslist-to-esbuild'

Expand Down
2 changes: 1 addition & 1 deletion packages/utils/theme/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'path'
import { terser } from 'rollup-plugin-terser'
import terser from '@rollup/plugin-terser'
import dts from 'vite-plugin-dts'
import browserslistToEsbuild from 'browserslist-to-esbuild'

Expand Down
3 changes: 1 addition & 2 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@
"jsx": "preserve",
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"target": "ESNext",
"module": "ESNext",
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
"useDefineForClassFields": true,
"allowSyntheticDefaultImports": true,
"moduleResolution": "Node",
"moduleResolution": "Bundler",
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"downlevelIteration": true,
"emitDeclarationOnly": false,
"noEmit": true,
"module": "ESNext",
"paths": {
"@docs/*": ["documentation/*"]
}
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node",
"moduleResolution": "NodeNext",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
Expand Down

0 comments on commit d25e644

Please sign in to comment.