Skip to content

Commit

Permalink
feat(cli.js): add CommonJS dist files (#2646)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Sep 24, 2021
1 parent 0f321ac commit 205b0dc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changes/cli.js-cjs-output.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"cli.js": patch
---

Added CommonJS output to the `dist` folder.
24 changes: 17 additions & 7 deletions tooling/cli.js/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 205b0dc

Please sign in to comment.