Browse Source

fix(api): export commonjs chunks with `.cjs` extension, fix #1625 (#1627)

Amr Bashir 4 years ago
parent
commit
ddcd9233bd
2 changed files with 6 additions and 0 deletions
  1. 5 0
      .changes/api-cjs-chunks.md
  2. 1 0
      tooling/api/rollup.config.js

+ 5 - 0
.changes/api-cjs-chunks.md

@@ -0,0 +1,5 @@
+---
+"api": patch
+---
+
+CommonJS chunks are now properly exported with `.cjs` extension

+ 1 - 0
tooling/api/rollup.config.js

@@ -36,6 +36,7 @@ export default [
         dir: 'dist/',
         entryFileNames: '[name].cjs',
         format: 'cjs',
+        chunkFileNames: '[name]-[hash].cjs',
         exports: 'named',
         globals: {}
       },