Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
"version": "5.1.0",
"description": "Moneytree Link JavaScript SDK",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./package.json": "./package.json"
},
"files": [
"dist/"
],
Expand Down
5 changes: 0 additions & 5 deletions sample/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,5 @@ export default defineConfig({
server: {
// So it can run without conflicting with Vault
port: 9001
},

// So it can bundle CJS -> ESM through the portal
optimizeDeps: {
include: ['@moneytree/mt-link-javascript-sdk']
}
});
22 changes: 14 additions & 8 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,22 @@ export default defineConfig({
build: {
outDir: 'dist',
lib: {
entry: path.resolve(__dirname, 'src/index.ts'),
formats: ['cjs'],
fileName: () => 'index.js'
entry: path.resolve(__dirname, 'src/index.ts')
},
rollupOptions: {
output: {
// Match the old webpack commonjs2 output shape: module.exports carries
// both the default export (under `.default`) and all named exports.
exports: 'named'
}
output: [
{
format: 'cjs',
entryFileNames: 'index.js',
// Match the old webpack commonjs2 output shape: module.exports carries
// both the default export (under `.default`) and all named exports.
exports: 'named'
},
{
format: 'es',
entryFileNames: 'index.mjs'
}
]
}
}
});