@knotx/build-config 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/index.ts +11 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@knotx/build-config",
3
3
  "type": "module",
4
- "version": "0.2.1",
4
+ "version": "0.2.2",
5
5
  "description": "Build config for Knotx",
6
6
  "author": "boenfu",
7
7
  "license": "MIT",
@@ -33,8 +33,8 @@
33
33
  "rollup": "^4.9.5"
34
34
  },
35
35
  "devDependencies": {
36
- "@knotx/eslint-config": "0.2.1",
37
- "@knotx/typescript-config": "0.2.1"
36
+ "@knotx/eslint-config": "0.2.2",
37
+ "@knotx/typescript-config": "0.2.2"
38
38
  },
39
39
  "scripts": {
40
40
  "lint": "eslint ."
package/src/index.ts CHANGED
@@ -16,6 +16,17 @@ export const buildConfig: BuildConfig = {
16
16
  jsxImportSource: '@knotx/jsx',
17
17
  },
18
18
  },
19
+ hooks: {
20
+ 'rollup:options': function (_, options) {
21
+ const output = Array.isArray(options.output) ? options.output : [options.output]
22
+ output.forEach((o) => {
23
+ if (o.format !== 'esm' || typeof o.entryFileNames !== 'string') {
24
+ return
25
+ }
26
+ o.entryFileNames = o.entryFileNames.replace('.mjs', '.js')
27
+ })
28
+ },
29
+ },
19
30
  failOnWarn: false,
20
31
  // 没想好,暂时不转换,默认使用 react-jsx
21
32
  // hooks: {
@@ -23,5 +34,4 @@ export const buildConfig: BuildConfig = {
23
34
  // options.plugins.push(jsxTransform())
24
35
  // },
25
36
  // },
26
- externals: [/^@knotx\/.+$/],
27
37
  }