Skip to content

Commit

Permalink
Fix rollup config with right plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyalIcing committed Jan 30, 2024
1 parent b31813f commit 8caa5fb
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 3 deletions.
92 changes: 92 additions & 0 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
"@adobe/react-spectrum": "^3.33.1",
"@headlessui/react": "^1.7.18",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.6",
"@swc/core": "^1.2.206",
"@swc/jest": "^0.2.21",
"@testing-library/dom": "^9",
Expand Down
13 changes: 10 additions & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const del = require('rollup-plugin-delete')
const commonjs = require('@rollup/plugin-commonjs')
const del = require('rollup-plugin-delete');
const commonjs = require('@rollup/plugin-commonjs');
const typescript = require('@rollup/plugin-typescript')
const { nodeResolve } = require('@rollup/plugin-node-resolve');

const entries = [
'./src/index.ts'
Expand All @@ -24,6 +26,11 @@ module.exports = [
],
external: id =>
!id.startsWith('\0') && !id.startsWith('.') && !id.startsWith('/'),
plugins: [del({ targets: 'dist/*' }), commonjs()],
plugins: [
del({ targets: 'dist/*' }),
nodeResolve({ extensions: ['.js', '.ts'] }),
commonjs(),
typescript({ tsconfig: "./tsconfig.json" })
],
},
]
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"target": "ES2015",
"lib": ["dom", "esnext"],
"emitDeclarationOnly": true,
// "allowImportingTsExtensions": true,
"importHelpers": true,
"declaration": true,
"sourceMap": true,
Expand Down

0 comments on commit 8caa5fb

Please sign in to comment.