Skip to content

Commit

Permalink
update rollup external packages
Browse files Browse the repository at this point in the history
  • Loading branch information
kolirt committed Mar 18, 2024
1 parent 8838edc commit 9586227
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"paths": {
"@/*": ["./src/*"]
}
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"verbatimModuleSyntax": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true
},
"exclude": ["test", "demo", "node_modules", "examples"]
}
12 changes: 9 additions & 3 deletions vite.lib.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { defineConfig } from 'vite'
import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js'
import dts from 'vite-plugin-dts'
import eslint from 'vite-plugin-eslint'
import pkg from './package.json'

export default defineConfig({
plugins: [
Expand All @@ -24,11 +25,16 @@ export default defineConfig({
},
emptyOutDir: true,
rollupOptions: {
external: ['vue', 'js-event-bus'],
external: [...Object.keys(pkg.dependencies)],
output: {
globals: {
vue: 'vue',
'js-event-bus': 'jsEventBus'
...(() => {
const obj: Record<string, string> = {}
Object.keys(pkg.dependencies).forEach((key) => {
obj[key] = key
})
return obj
})()
}
}
}
Expand Down

0 comments on commit 9586227

Please sign in to comment.