diff --git a/package-lock.json b/package-lock.json index 91a4872..57fb7bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,8 +36,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", - "serialize-javascript": ">=6.0.1", "sinon": "^17.0.0", "sinon-chai": "^3.7.0", "ts-node": "^10.9.1", @@ -7259,12 +7257,6 @@ "typescript": "^4.5 || ^5.0" } }, - "node_modules/rollup-plugin-mjs-entry": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-mjs-entry/-/rollup-plugin-mjs-entry-0.1.1.tgz", - "integrity": "sha512-uii0Txyrn4YCgP++fypLqsT3LgO3Fx0gAZLZlWRSwKCuZ+bdSzAzdVbJFATmCHcBNlO61i65EgemOVdVQYONHA==", - "dev": true - }, "node_modules/rrweb-cssom": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", @@ -7438,15 +7430,6 @@ "node": ">=10" } }, - "node_modules/serialize-javascript": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", - "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", - "dev": true, - "dependencies": { - "randombytes": "^2.1.0" - } - }, "node_modules/set-function-length": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.1.tgz", diff --git a/package.json b/package.json index 6d8f4b2..e754a26 100644 --- a/package.json +++ b/package.json @@ -71,8 +71,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", - "serialize-javascript": ">=6.0.1", "sinon": "^17.0.0", "sinon-chai": "^3.7.0", "ts-node": "^10.9.1", diff --git a/rollup.config.js b/rollup.config.js index 1296009..305892d 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -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" @@ -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: [ @@ -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() ], external: [ 'live-connect-common',