@deot/dev-builder 2.5.0 → 2.5.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.
package/dist/index.cjs CHANGED
@@ -64,28 +64,36 @@ const run$3 = async (options) => {
64
64
  if (!files.length)
65
65
  return stats;
66
66
  const build = async (format) => {
67
- process.env.BUILD_OPTIONS = encodeURIComponent(JSON.stringify({
67
+ const buildOptions = {
68
68
  files,
69
69
  format,
70
70
  workspace,
71
71
  packageName,
72
72
  packageDir,
73
73
  packageSourceDir: srcDir,
74
- packageOptions
75
- }));
74
+ packageOptions,
75
+ // 这个是给外部调用(z.)?build.config.ts用的
76
+ useVue: false,
77
+ useReact: false
78
+ };
76
79
  let options$ = {
77
80
  build: {
78
81
  write: false
79
82
  }
80
83
  };
84
+ buildOptions.useVue = !!isVuePackage;
85
+ buildOptions.useReact = !!isReactPackage;
81
86
  if (fs.existsSync(`${cwd}/z.build.config.ts`)) {
82
87
  options$.configFile = path__namespace.relative(cwd, path__namespace.resolve(cwd, "./z.build.config.ts"));
83
88
  } else if (fs.existsSync(`${cwd}/build.config.ts`)) {
84
89
  options$.configFile = path__namespace.relative(cwd, path__namespace.resolve(cwd, "./build.config.ts"));
85
90
  } else {
91
+ process.env.USE_VUE = isVuePackage ? "1" : "";
92
+ process.env.USE_REACT = isReactPackage ? "1" : "";
86
93
  options$.configFile = path__namespace.relative(cwd, path__namespace.resolve(dirname$1, "../shared.config.ts"));
87
94
  options$ = isVuePackage ? vite.mergeConfig(sharedVueConfig, options$) : isReactPackage ? vite.mergeConfig(sharedReactConfig, options$) : options$;
88
95
  }
96
+ process.env.BUILD_OPTIONS = encodeURIComponent(JSON.stringify(buildOptions));
89
97
  let viteBuild = await vite.build(options$);
90
98
  return viteBuild;
91
99
  };
package/dist/index.es.js CHANGED
@@ -39,28 +39,36 @@ const run$3 = async (options) => {
39
39
  if (!files.length)
40
40
  return stats;
41
41
  const build = async (format) => {
42
- process.env.BUILD_OPTIONS = encodeURIComponent(JSON.stringify({
42
+ const buildOptions = {
43
43
  files,
44
44
  format,
45
45
  workspace,
46
46
  packageName,
47
47
  packageDir,
48
48
  packageSourceDir: srcDir,
49
- packageOptions
50
- }));
49
+ packageOptions,
50
+ // 这个是给外部调用(z.)?build.config.ts用的
51
+ useVue: false,
52
+ useReact: false
53
+ };
51
54
  let options$ = {
52
55
  build: {
53
56
  write: false
54
57
  }
55
58
  };
59
+ buildOptions.useVue = !!isVuePackage;
60
+ buildOptions.useReact = !!isReactPackage;
56
61
  if (fs$1.existsSync(`${cwd}/z.build.config.ts`)) {
57
62
  options$.configFile = path.relative(cwd, path.resolve(cwd, "./z.build.config.ts"));
58
63
  } else if (fs$1.existsSync(`${cwd}/build.config.ts`)) {
59
64
  options$.configFile = path.relative(cwd, path.resolve(cwd, "./build.config.ts"));
60
65
  } else {
66
+ process.env.USE_VUE = isVuePackage ? "1" : "";
67
+ process.env.USE_REACT = isReactPackage ? "1" : "";
61
68
  options$.configFile = path.relative(cwd, path.resolve(dirname$1, "../shared.config.ts"));
62
69
  options$ = isVuePackage ? mergeConfig(sharedVueConfig, options$) : isReactPackage ? mergeConfig(sharedReactConfig, options$) : options$;
63
70
  }
71
+ process.env.BUILD_OPTIONS = encodeURIComponent(JSON.stringify(buildOptions));
64
72
  let viteBuild = await build$1(options$);
65
73
  return viteBuild;
66
74
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deot/dev-builder",
3
- "version": "2.5.0",
3
+ "version": "2.5.2",
4
4
  "type": "module",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",
@@ -29,9 +29,9 @@
29
29
  }
30
30
  },
31
31
  "dependencies": {
32
- "@deot/dev-react": "^2.5.0",
32
+ "@deot/dev-react": "^2.5.1",
33
33
  "@deot/dev-shared": "^2.5.0",
34
- "@deot/dev-vue": "^2.5.0",
34
+ "@deot/dev-vue": "^2.5.1",
35
35
  "@microsoft/api-extractor": "^7.36.4",
36
36
  "autoprefixer": "^10.4.15",
37
37
  "chalk": "^5.3.0",