Skip to content

Commit

Permalink
Merge pull request #80 from inloco/chore/change-commonjs-extension
Browse files Browse the repository at this point in the history
Change commonJS extension
  • Loading branch information
FranciscoGileno authored Jul 8, 2024
2 parents 5bd0dd5 + 71a63ce commit 42e58d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
"version": "5.0.0",
"license": "MIT",
"type": "module",
"main": "dist/index.cjs.js",
"main": "dist/index.cjs",
"module": "dist/index.es.js",
"typings": "dist/index.d.ts",
"files": [
"dist"
],
"exports": {
".": {
"require": "./dist/index.cjs.js",
"require": "./dist/index.cjs",
"import": "./dist/index.es.js"
}
},
Expand Down
5 changes: 4 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ export default defineConfig({
lib: {
entry: path.resolve(__dirname, 'src/index.ts'),
formats: ['es', 'cjs'],
fileName: format => `index.${format}.js`
fileName: format => {
if (format === 'cjs') return `index.${format}`
return `index.${format}.js`
}
},
rollupOptions: {
external: [...Object.keys(dependencies)],
Expand Down

0 comments on commit 42e58d7

Please sign in to comment.