Skip to content

Commit

Permalink
[CM-1203] Drop mjs-entry plugin (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
mschuwalow authored Mar 22, 2024
1 parent 664a35b commit ffd9f3f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
7 changes: 0 additions & 7 deletions package-lock.json

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

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
"node": ">=18"
},
"main": "./dist/index.cjs",
"module": "./dist/index.cjs.mjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.cjs",
"import": "./dist/index.cjs.mjs"
"import": "./dist/index.mjs"
},
"./package.json": "./package.json"
},
Expand Down Expand Up @@ -64,7 +64,6 @@
"rollup-plugin-cleaner": "^1.0.0",
"rollup-plugin-delete": "^2.0.0",
"rollup-plugin-dts": "^6.0.1",
"rollup-plugin-mjs-entry": "^0.1.1",
"ts-node": "^10.9.2",
"typescript": "^5.1.3"
}
Expand Down
15 changes: 11 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import strip from '@rollup/plugin-strip'
import ts from '@rollup/plugin-typescript'
import cleaner from 'rollup-plugin-cleaner'
import mjsEntry from 'rollup-plugin-mjs-entry'
import dts from 'rollup-plugin-dts'
import del from "rollup-plugin-delete";

Expand All @@ -12,9 +11,18 @@ export default [
input: './src/index.ts',
output: [
{
file: `${OUTPUT_DIR}/index.cjs`,
dir: OUTPUT_DIR,
entryFileNames: '[name].cjs',
chunkFileNames: '[name]-[hash].cjs',
format: 'cjs',
sourcemap: false
},
{
dir: OUTPUT_DIR,
entryFileNames: '[name].mjs',
chunkFileNames: '[name]-[hash].mjs',
format: 'es',
sourcemap: false
}
],
plugins: [
Expand All @@ -25,8 +33,7 @@ export default [
declarationDir: `${OUTPUT_DIR}/dts`,
}
}),
strip(),
mjsEntry() // https://nodejs.org/api/packages.html#packages_dual_commonjs_es_module_packages
strip()
]
},
{
Expand Down

0 comments on commit ffd9f3f

Please sign in to comment.