@flatjs/evolve 2.2.3 → 2.2.5

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.
@@ -1 +1 @@
1
- import{mergeOptions}from"@flatjs/common";export const createExternals=(t={},e)=>{const o=e?.[1];return mergeOptions(t,o?.options?.externals||{})};
1
+ import{mergeOptions}from"@flatjs/common";export const createExternals=(t={},e)=>{let o=t;"function"==typeof t&&(o=t());const n=e?.[1];return mergeOptions(o,n?.options?.externals||{})};
@@ -41,8 +41,19 @@ export interface FlatEvolveWebpackOptions extends Pick<Configuration, 'performan
41
41
  * 'react-dom': 'ReactDOM',
42
42
  * }
43
43
  * ```
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * externals: () => ({
48
+ * vue: 'Vue',
49
+ * react: 'React',
50
+ * 'react-dom': 'ReactDOM',
51
+ * })
52
+ * ```
53
+ *
54
+ * If use function, it will be override default externals.
44
55
  */
45
- externals?: Record<string, string>;
56
+ externals?: Record<string, string> | (() => Record<string, string>);
46
57
  /**
47
58
  * output.publicPath defaults to 'auto' with web and web-worker targets
48
59
  * @default 'auto'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flatjs/evolve",
3
- "version": "2.2.3",
3
+ "version": "2.2.5",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -43,12 +43,12 @@
43
43
  "@babel/core": "^7.26.8",
44
44
  "@clack/prompts": "^0.10.0",
45
45
  "@discoveryjs/json-ext": "0.6.3",
46
- "@flatjs/babel-plugin-import": "2.2.3",
46
+ "@flatjs/babel-plugin-import": "2.2.5",
47
47
  "@flatjs/common": "2.2.0",
48
48
  "@flatjs/evolve-preset-babel": "2.2.0",
49
49
  "@flatjs/forge-postcss-plugin-pixel": "2.2.0",
50
- "@flatjs/graph": "2.2.3",
51
- "@flatjs/mock": "2.3.3",
50
+ "@flatjs/graph": "2.2.5",
51
+ "@flatjs/mock": "2.3.5",
52
52
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.15",
53
53
  "@types/babel__core": "^7.20.5",
54
54
  "babel-loader": "^9.2.1",