diff --git a/.changes/cli.js-cjs-output.md b/.changes/cli.js-cjs-output.md new file mode 100644 index 000000000..53bf7d818 --- /dev/null +++ b/.changes/cli.js-cjs-output.md @@ -0,0 +1,5 @@ +--- +"cli.js": patch +--- + +Added CommonJS output to the `dist` folder. diff --git a/tooling/cli.js/rollup.config.js b/tooling/cli.js/rollup.config.js index 6166562b3..036e43084 100644 --- a/tooling/cli.js/rollup.config.js +++ b/tooling/cli.js/rollup.config.js @@ -27,13 +27,23 @@ export default { }, treeshake: true, perf: true, - output: { - dir: 'dist/', - entryFileNames: '[name].js', - format: 'esm', - exports: 'named', - globals: {} - }, + output: [ + { + dir: 'dist/', + entryFileNames: '[name].js', + format: 'esm', + exports: 'named', + globals: {} + }, + { + dir: 'dist/', + entryFileNames: '[name].cjs', + format: 'cjs', + chunkFileNames: '[name]-[hash].cjs', + exports: 'named', + globals: {} + } + ], plugins: [ replace({ __RUST_CLI_VERSION__: JSON.stringify(cliManifest.package.version),