@nocobase/build 2.1.0-beta.37 → 2.1.0-beta.40

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.
@@ -25,7 +25,8 @@ function myLoader(source) {
25
25
  if (!options?.isCommercial) {
26
26
  return source;
27
27
  }
28
- const isEntry = this.resourcePath.match(/client\/index\.(ts|tsx)/) && !this.resourcePath.includes("plugin-commercial");
28
+ const isClientV2Plugin = this.resourcePath.match(/client-v2\/plugin\.(ts|tsx)/) && !this.resourcePath.includes("plugin-commercial");
29
+ const isEntry = (this.resourcePath.match(/client\/index\.(ts|tsx)/) || isClientV2Plugin) && !this.resourcePath.includes("plugin-commercial");
29
30
  if (isEntry) {
30
31
  const regex = /export\s+default\s+([a-zA-Z_0-9]+)\s*;?/;
31
32
  const match = source.match(regex);
@@ -33,7 +34,7 @@ function myLoader(source) {
33
34
  source = source.replace(regex, ``);
34
35
  const moduleName = match[1];
35
36
  source = `
36
- import { withCommercial } from '@nocobase/plugin-commercial/client';
37
+ import { withCommercial } from '@nocobase/plugin-commercial/${isClientV2Plugin ? "client-v2" : "client"}';
37
38
  ${source}
38
39
  export default withCommercial(${moduleName});
39
40
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/build",
3
- "version": "2.1.0-beta.37",
3
+ "version": "2.1.0-beta.40",
4
4
  "description": "Library build tool based on rollup.",
5
5
  "main": "lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -53,5 +53,5 @@
53
53
  "build": "tsup",
54
54
  "build:watch": "tsup --watch"
55
55
  },
56
- "gitHead": "7132e5b83ecc0e42b54715eaf1429c72bcef34ae"
56
+ "gitHead": "36e906138f6305723abbef676a61006058feb5ea"
57
57
  }