Browse Source

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

Amr Bashir 4 năm trước cách đây
mục cha
commit
ddcd9233bd
2 tập tin đã thay đổi với 6 bổ sung0 xóa
  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: {}
       },