Skip to content

Commit

Permalink
fix(build): ensure external deps are not bundled (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nanosync authored Jan 10, 2024
1 parent 3bdc152 commit 2cb388c
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions packages/ord-connect/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@ import * as packageJson from "./package.json";

// https://vitejs.dev/config/
export default defineConfig({
optimizeDeps: {
esbuildOptions: {
// Node.js global to browser globalThis
define: {
global: "globalThis",
},
},
include: [...Object.keys(packageJson.peerDependencies)],
},
build: {
lib: {
entry: {
Expand All @@ -27,10 +18,17 @@ export default defineConfig({
formats: ["es"],
},
rollupOptions: {
external: [...Object.keys(packageJson.peerDependencies)],
external: [
...Object.keys(packageJson.peerDependencies),
/^@ordzaar\/ordit-sdk\/.*/, // ordit-sdk/unisat, ordit-sdk/xverse imports
],
},
commonjsOptions: {
include: [/node_modules/, ...Object.keys(packageJson.peerDependencies)],
include: [
/node_modules/,
...Object.keys(packageJson.peerDependencies),
/^@ordzaar\/ordit-sdk\/.*/, // ordit-sdk/unisat, ordit-sdk/xverse imports
],
},
},
plugins: [
Expand All @@ -41,9 +39,9 @@ export default defineConfig({
eslint(),
cssInjectedByJsPlugin(),
nodePolyfills({
// Whether to polyfill specific globals.
globals: {
Buffer: true, // can also be 'build', 'dev', or false
// required for ordit-sdk functionality
Buffer: true,
},
}),
],
Expand Down

0 comments on commit 2cb388c

Please sign in to comment.