@omnific/react-scripts 0.1.0 → 0.1.1

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.js CHANGED
@@ -1,29 +1,318 @@
1
1
  #!/usr/bin/env node
2
- import { n as PRODUCTION, o as setEnv, t as DEVELOPMENT } from "./env-DxzdvROc.js";
3
- import { styleText } from "node:util";
2
+ import { t as startBuild } from "./build-DYTkS36_.js";
3
+ import { a as isDevelopment, i as getEnv, n as DEVELOPMENT, o as isProduction, r as PRODUCTION, t as paths_default } from "./paths-BvJwGeTv.js";
4
+ import { t as startDev } from "./dev-jQizUhIq.js";
5
+ import { createRequire } from "node:module";
6
+ import { parseArgs, styleText } from "node:util";
7
+ import { merge } from "webpack-merge";
8
+ import { rspack } from "@rspack/core";
9
+ import path from "node:path";
10
+ import { existsSync } from "node:fs";
11
+ import { ReactRefreshRspackPlugin } from "@rspack/plugin-react-refresh";
12
+ //#region utils/find-entry-file.ts
13
+ const fileExtensions = [
14
+ "ts",
15
+ "mts",
16
+ "mjs",
17
+ "cjs",
18
+ "js"
19
+ ];
20
+ /**
21
+ * Find a file with any of the supported JavaScript extensions
22
+ * @param basePath - The base path without extension
23
+ * @returns The file path with extension if found, or a default path
24
+ */
25
+ function findEntryFile(basePath) {
26
+ for (const ext of fileExtensions) {
27
+ const filePath = `${basePath}.${ext}`;
28
+ if (existsSync(filePath)) return filePath;
29
+ }
30
+ }
31
+ //#endregion
32
+ //#region utils/detect-package.ts
33
+ const require$1 = createRequire(import.meta.url);
34
+ function detectPackage(packageName) {
35
+ try {
36
+ require$1.resolve(packageName);
37
+ return true;
38
+ } catch {
39
+ return false;
40
+ }
41
+ }
42
+ //#endregion
43
+ //#region alias.ts
44
+ const moduleFileExtensions = [
45
+ "ts",
46
+ "tsx",
47
+ "js",
48
+ "json",
49
+ "mjs",
50
+ "jsx"
51
+ ].map((ext) => `.${ext}`);
52
+ const aliasSymbol = {
53
+ src: "@",
54
+ root: "@app"
55
+ };
56
+ const alias = {
57
+ [aliasSymbol.src]: paths_default.appSrc,
58
+ [aliasSymbol.root]: paths_default.appPath
59
+ };
60
+ //#endregion
61
+ //#region rspack.config.ts
62
+ const hasJsxRuntime = detectPackage("react/jsx-runtime");
63
+ const hasTailwind = detectPackage("tailwindcss");
64
+ const hasSwcHelper = detectPackage("@swc/helpers");
65
+ const lessRegex = /\.less$/;
66
+ const sassRegex = /\.(scss|sass)$/;
67
+ const cssRegex = /\.css$/;
68
+ const imageInlineSizeLimit = 1e4;
69
+ const require = createRequire(import.meta.url);
70
+ function resolvePackage(packageName) {
71
+ return require.resolve(packageName);
72
+ }
73
+ function createRspackConfig() {
74
+ const isEnvironmentDevelopment = isDevelopment();
75
+ const isEnvironmentProduction = isProduction();
76
+ function getStyleLoaders(preProcessor) {
77
+ const loaders = [
78
+ isEnvironmentProduction && {
79
+ loader: rspack.CssExtractRspackPlugin.loader,
80
+ options: paths_default.publicUrlOrPath.startsWith(".") ? { publicPath: "../../" } : {}
81
+ },
82
+ {
83
+ loader: "builtin:lightningcss-loader",
84
+ /** @type {import('@rspack/core').LightningcssLoaderOptions} */
85
+ options: { minify: isEnvironmentProduction }
86
+ },
87
+ {
88
+ loader: resolvePackage("postcss-loader"),
89
+ options: hasTailwind ? { postcssOptions: {
90
+ ident: "postcss",
91
+ config: false,
92
+ plugins: [require("@tailwindcss/postcss")]
93
+ } } : void 0
94
+ }
95
+ ].filter(Boolean);
96
+ if (preProcessor) loaders.push(preProcessor);
97
+ return loaders;
98
+ }
99
+ return {
100
+ target: ["browserslist"],
101
+ stats: "errors-warnings",
102
+ mode: getEnv(),
103
+ bail: isEnvironmentProduction,
104
+ devtool: isEnvironmentDevelopment && "cheap-module-source-map",
105
+ entry: paths_default.appIndexJs,
106
+ output: {
107
+ path: paths_default.appBuild,
108
+ pathinfo: isEnvironmentDevelopment,
109
+ filename: isEnvironmentProduction ? "static/js/[name].[contenthash:8].js" : "static/js/[name].js",
110
+ chunkFilename: isEnvironmentProduction ? "static/js/[name].[contenthash:8].chunk.js" : "static/js/[name].chunk.js",
111
+ assetModuleFilename: "static/media/[name].[hash][ext]",
112
+ publicPath: paths_default.publicUrlOrPath,
113
+ devtoolModuleFilenameTemplate: isEnvironmentProduction ? (info) => path.relative(paths_default.appSrc, info.absoluteResourcePath).replaceAll("\\", "/") : (info) => path.resolve(info.absoluteResourcePath).replaceAll("\\", "/")
114
+ },
115
+ infrastructureLogging: { level: "none" },
116
+ optimization: {
117
+ runtimeChunk: "single",
118
+ splitChunks: {
119
+ chunks: "async",
120
+ minChunks: 1,
121
+ minSize: 2e4,
122
+ maxAsyncRequests: 30,
123
+ maxInitialRequests: 30,
124
+ cacheGroups: {
125
+ vendors: {
126
+ test: /[/\\]node_modules[/\\]/,
127
+ name: "chunk-vendors",
128
+ priority: -10,
129
+ reuseExistingChunk: true
130
+ },
131
+ default: {
132
+ minChunks: 2,
133
+ priority: -20,
134
+ reuseExistingChunk: true
135
+ }
136
+ }
137
+ },
138
+ minimizer: [new rspack.LightningCssMinimizerRspackPlugin(), new rspack.SwcJsMinimizerRspackPlugin({
139
+ extractComments: false,
140
+ minimizerOptions: {
141
+ minify: true,
142
+ mangle: true,
143
+ ecma: 5,
144
+ compress: { passes: 2 },
145
+ format: { comments: false }
146
+ }
147
+ })]
148
+ },
149
+ resolve: {
150
+ extensions: moduleFileExtensions,
151
+ alias
152
+ },
153
+ module: {
154
+ rules: [{ oneOf: [
155
+ {
156
+ test: [/\.avif$/],
157
+ type: "asset",
158
+ mimetype: "image/avif",
159
+ parser: { dataUrlCondition: { maxSize: imageInlineSizeLimit } }
160
+ },
161
+ {
162
+ test: [
163
+ /\.bmp$/,
164
+ /\.gif$/,
165
+ /\.jpe?g$/,
166
+ /\.png$/
167
+ ],
168
+ type: "asset",
169
+ parser: { dataUrlCondition: { maxSize: imageInlineSizeLimit } }
170
+ },
171
+ {
172
+ test: /\.[jt]sx?$/,
173
+ exclude: [/node_modules/],
174
+ use: {
175
+ loader: "builtin:swc-loader",
176
+ options: {
177
+ jsc: {
178
+ externalHelpers: hasSwcHelper,
179
+ loose: true,
180
+ parser: {
181
+ syntax: "typescript",
182
+ tsx: true
183
+ },
184
+ transform: { react: {
185
+ throwIfNamespace: true,
186
+ development: isEnvironmentDevelopment,
187
+ useBuiltins: true,
188
+ runtime: hasJsxRuntime ? "automatic" : "classic",
189
+ refresh: isEnvironmentDevelopment
190
+ } }
191
+ },
192
+ module: { type: "es6" }
193
+ }
194
+ }
195
+ },
196
+ {
197
+ test: lessRegex,
198
+ use: getStyleLoaders({ loader: resolvePackage("less-loader") }),
199
+ sideEffects: true,
200
+ type: "css/auto"
201
+ },
202
+ {
203
+ test: sassRegex,
204
+ use: getStyleLoaders({
205
+ loader: resolvePackage("sass-loader"),
206
+ options: {
207
+ api: "modern-compiler",
208
+ implementation: resolvePackage("sass-embedded")
209
+ }
210
+ }),
211
+ sideEffects: true,
212
+ type: "css/auto"
213
+ },
214
+ {
215
+ test: cssRegex,
216
+ use: getStyleLoaders(),
217
+ sideEffects: true,
218
+ type: "css/auto"
219
+ },
220
+ {
221
+ exclude: [
222
+ /^$/,
223
+ /\.(js|mjs|jsx|ts|tsx)$/,
224
+ /\.html$/,
225
+ /\.json$/
226
+ ],
227
+ type: "asset/resource"
228
+ }
229
+ ] }],
230
+ parser: { "css/auto": { namedExports: false } }
231
+ },
232
+ plugins: [
233
+ new rspack.HtmlRspackPlugin({
234
+ inject: true,
235
+ template: paths_default.appHtml,
236
+ minify: isEnvironmentProduction
237
+ }),
238
+ isEnvironmentDevelopment && new rspack.CaseSensitivePlugin(),
239
+ isEnvironmentDevelopment && new ReactRefreshRspackPlugin()
240
+ ],
241
+ performance: false
242
+ };
243
+ }
244
+ //#endregion
245
+ //#region Service.ts
246
+ var Service = class {
247
+ initialized = false;
248
+ mode = DEVELOPMENT;
249
+ commands = {
250
+ dev: startDev,
251
+ build: startBuild
252
+ };
253
+ projectOptions;
254
+ webpackRawConfigFns = [];
255
+ async init(mode) {
256
+ if (this.initialized) return;
257
+ this.initialized = true;
258
+ this.mode = mode;
259
+ this.loadEnv(mode);
260
+ await this.loaderUserConfig();
261
+ }
262
+ async run(name) {
263
+ let command = this.commands[name];
264
+ if (!command && name) throw new Error(`command "${name}" does not exist.`);
265
+ let mode = name === "dev" ? DEVELOPMENT : PRODUCTION;
266
+ await this.init(mode);
267
+ await command({
268
+ mode,
269
+ service: this,
270
+ rspackConfig: this.resolveRspackConfig()
271
+ });
272
+ }
273
+ async loaderUserConfig() {
274
+ const configPath = findEntryFile(paths_default.config);
275
+ if (configPath) {
276
+ const res = await import(configPath);
277
+ this.handleLoadedUserConfig(res.default);
278
+ }
279
+ }
280
+ resolveRspackConfig() {
281
+ if (!this.initialized) throw new Error("Service must call init() before calling resolveRspackConfig().");
282
+ let baseConfig = createRspackConfig();
283
+ for (const fn of this.webpackRawConfigFns) if (typeof fn === "function") {
284
+ const res = fn(baseConfig);
285
+ if (res) baseConfig = merge(baseConfig, res);
286
+ }
287
+ return baseConfig;
288
+ }
289
+ loadEnv(mode) {
290
+ process.env.NODE_ENV = mode;
291
+ }
292
+ handleLoadedUserConfig(data) {
293
+ this.projectOptions = data;
294
+ if (data.configureRspack) this.webpackRawConfigFns.push(data.configureRspack);
295
+ }
296
+ };
297
+ //#endregion
4
298
  //#region index.ts
5
- process.on("unhandledRejection", (error) => {
6
- if (error instanceof Error) {
7
- console.log(styleText("red", error.message));
8
- process.exit(1);
9
- } else throw error;
299
+ process.on("unhandledRejection", consoleError);
300
+ const args = parseArgs({
301
+ args: process.argv.slice(2),
302
+ strict: false,
303
+ allowPositionals: true
10
304
  });
11
- const args = process.argv.slice(2);
12
- const scriptLoaders = {
13
- build: () => import("./scripts/build.js"),
14
- dev: () => import("./scripts/dev.js")
15
- };
16
- const scriptIndex = args.findIndex((script) => script === "build" || script === "dev");
17
- if (scriptIndex === -1) {
18
- console.log("Unknown script \"" + args[0] + "\".");
305
+ const service = new Service();
306
+ const command = args.positionals[0];
307
+ try {
308
+ await service.run(command);
309
+ } catch (error) {
310
+ consoleError(error);
311
+ }
312
+ function consoleError(value) {
313
+ if (value instanceof Error) console.log(styleText("red", value.message));
314
+ else console.log(styleText("red", String(value)));
19
315
  process.exit(1);
20
- } else {
21
- const script = args[scriptIndex];
22
- setEnv({
23
- NODE_ENV: script === "dev" ? DEVELOPMENT : PRODUCTION,
24
- SCRIPT: script
25
- });
26
- await scriptLoaders[script]();
27
316
  }
28
317
  //#endregion
29
318
  export {};
package/dist/main.d.ts CHANGED
@@ -19,12 +19,12 @@ declare const _default: {
19
19
  declare function getEnv(): string;
20
20
  declare function isDevelopment(): boolean;
21
21
  declare function isProduction(): boolean;
22
- declare function isBuild(): boolean;
23
22
  //#endregion
24
23
  //#region main.d.ts
24
+ type ConfigureRspack = (config: Configuration) => Configuration;
25
25
  type ReactScriptsConfig = {
26
- configureRspack?: (config: Configuration) => Configuration;
26
+ configureRspack?: ConfigureRspack;
27
27
  };
28
28
  declare function defineConfig(config: ReactScriptsConfig): ReactScriptsConfig;
29
29
  //#endregion
30
- export { ReactScriptsConfig, defineConfig, getEnv, isBuild, isDevelopment, isProduction, _default as paths };
30
+ export { ConfigureRspack, ReactScriptsConfig, defineConfig, getEnv, isDevelopment, isProduction, _default as paths };
package/dist/main.js CHANGED
@@ -12,9 +12,6 @@ function isDevelopment() {
12
12
  function isProduction() {
13
13
  return getEnv() === PRODUCTION;
14
14
  }
15
- function isBuild() {
16
- return process.env.SCRIPT === "build";
17
- }
18
15
  //#endregion
19
16
  //#region paths.ts
20
17
  const appDirectory = fs.realpathSync(process.cwd());
@@ -40,4 +37,4 @@ function defineConfig(config) {
40
37
  return config;
41
38
  }
42
39
  //#endregion
43
- export { defineConfig, getEnv, isBuild, isDevelopment, isProduction, paths_default as paths };
40
+ export { defineConfig, getEnv, isDevelopment, isProduction, paths_default as paths };
@@ -0,0 +1,35 @@
1
+ import path from "node:path";
2
+ import fs from "node:fs";
3
+ //#region utils/env.ts
4
+ const DEVELOPMENT = "development";
5
+ const PRODUCTION = "production";
6
+ function getEnv() {
7
+ return process.env.NODE_ENV || "development";
8
+ }
9
+ function isDevelopment() {
10
+ return getEnv() === DEVELOPMENT;
11
+ }
12
+ function isProduction() {
13
+ return getEnv() === PRODUCTION;
14
+ }
15
+ //#endregion
16
+ //#region paths.ts
17
+ const appDirectory = fs.realpathSync(process.cwd());
18
+ function resolveApp(relativePath) {
19
+ return path.resolve(appDirectory, relativePath);
20
+ }
21
+ var paths_default = {
22
+ appSrc: resolveApp("src"),
23
+ appPath: resolveApp("."),
24
+ appBuild: resolveApp("build"),
25
+ appIndexJs: resolveApp("src/index.tsx"),
26
+ publicUrlOrPath: isDevelopment() ? "/" : "./",
27
+ appHtml: resolveApp("public/index.html"),
28
+ appTsConfig: resolveApp("./tsconfig.json"),
29
+ appNodeModules: resolveApp("node_modules"),
30
+ appPackageJson: resolveApp("package.json"),
31
+ appPublic: resolveApp("public"),
32
+ config: resolveApp("react-scripts.config")
33
+ };
34
+ //#endregion
35
+ export { isDevelopment as a, getEnv as i, DEVELOPMENT as n, isProduction as o, PRODUCTION as r, paths_default as t };
@@ -1,195 +1,2 @@
1
- import { n as paths_default, t as createRspackConfig } from "../rspack.config-8gFQGJU3.js";
2
- import { styleText } from "node:util";
3
- import fs from "node:fs/promises";
4
- import { exit } from "node:process";
5
- import { rspack } from "@rspack/core";
6
- import path from "node:path";
7
- import fs$1 from "node:fs";
8
- import prettyBytes from "pretty-bytes";
9
- import zlib from "node:zlib";
10
- //#region utils/fs-extra.ts
11
- async function emptyDirectory(directory) {
12
- await fs.rm(directory, {
13
- recursive: true,
14
- force: true
15
- });
16
- await fs.mkdir(directory, { recursive: true });
17
- }
18
- /**
19
- * 读取文件夹下的所有文件
20
- * @param path
21
- * @returns
22
- */
23
- async function readdir(path$1) {
24
- let fileList = [];
25
- const files = await fs.readdir(path$1);
26
- if (files.length === 0) return [];
27
- for (const file of files) {
28
- const filePath = path.join(path$1, file);
29
- if ((await fs.stat(filePath)).isDirectory()) fileList = [...fileList, ...await readdir(filePath)];
30
- else fileList.push(filePath);
31
- }
32
- return fileList;
33
- }
34
- //#endregion
35
- //#region utils/gzip-size.ts
36
- function getOptions(options) {
37
- return {
38
- level: 9,
39
- ...options
40
- };
41
- }
42
- function gzipSync(input, options) {
43
- return zlib.gzipSync(input, getOptions(options)).length;
44
- }
45
- //#endregion
46
- //#region utils/strip-ansi.ts
47
- function ansiRegex(options = {}) {
48
- const { onlyFirst } = options;
49
- const pattern = [String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`, String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");
50
- return new RegExp(pattern, onlyFirst ? void 0 : "g");
51
- }
52
- function stripAnsi(string) {
53
- const regex = ansiRegex();
54
- return string.replace(regex, "");
55
- }
56
- //#endregion
57
- //#region utils/file-size-reporter.ts
58
- const WARN_AFTER_BUNDLE_GZIP_SIZE = 512 * 1024;
59
- const WARN_AFTER_CHUNK_GZIP_SIZE = 1024 * 1024;
60
- /**
61
- * 是不是可以读取的资源
62
- * @param asset
63
- * @returns
64
- */
65
- function canReadAsset(asset) {
66
- return /\.(js|css)$/.test(asset) && !/service-worker\.js/.test(asset) && !/precache-manifest\.[\da-f]+\.js/.test(asset);
67
- }
68
- function removeFileNameHash(buildFolder, fileName) {
69
- return fileName.replace(buildFolder, "").replaceAll("\\", "/").replace(/\/?(.*)(\.[\da-f]+)(\.chunk)?(\.js|\.css)/, (match, p1, p2, p3, p4) => p1 + p4);
70
- }
71
- async function measureFileSizesBeforeBuild(buildFolder) {
72
- const result = {
73
- root: buildFolder,
74
- sizes: {}
75
- };
76
- try {
77
- const files = await readdir(buildFolder);
78
- if (Array.isArray(files) && files.length > 0) {
79
- const canReadAssetFiles = files.filter((item) => canReadAsset(item));
80
- for (const fileName of canReadAssetFiles) {
81
- const stats = fs$1.statSync(fileName);
82
- const fileKey = removeFileNameHash(buildFolder, fileName);
83
- result.sizes[fileKey] = stats.size;
84
- }
85
- }
86
- } catch {
87
- return result;
88
- }
89
- return result;
90
- }
91
- function getDifferenceLabel(currentSize, previousSize) {
92
- const FIFTY_KILOBYTES = 1024 * 50;
93
- const difference = currentSize - previousSize;
94
- const fileSize = Number.isNaN(difference) ? "0" : prettyBytes(difference);
95
- if (difference >= FIFTY_KILOBYTES) return styleText("red", "+" + fileSize);
96
- else if (difference < FIFTY_KILOBYTES && difference > 0) return styleText("yellow", "+" + fileSize);
97
- else if (difference < 0) return styleText("green", fileSize);
98
- else return "";
99
- }
100
- function printFileSizesAfterBuild(stats, previousSizeMap) {
101
- let suggestBundleSplitting = false;
102
- const root = previousSizeMap.root;
103
- const sizes = previousSizeMap.sizes;
104
- const statCompilation = stats.toJson({
105
- all: false,
106
- assets: true
107
- });
108
- if (statCompilation.assets) {
109
- const assets = [];
110
- const gzipLabelLengthList = [];
111
- const sizeLabelLengthList = [];
112
- for (const asset of statCompilation.assets) {
113
- if (!canReadAsset(asset.name)) continue;
114
- const fileContents = fs$1.readFileSync(path.join(root, asset.name));
115
- const previousSize = sizes[removeFileNameHash(root, asset.name)];
116
- const difference = getDifferenceLabel(asset.size, previousSize);
117
- const sizeLabel = prettyBytes(asset.size) + (difference ? " (" + difference + ")" : "");
118
- const gzipLabel = "gzip : " + prettyBytes(gzipSync(fileContents));
119
- const sizeLabelLength = stripAnsi(sizeLabel).length;
120
- const gzipLabelLength = stripAnsi(gzipLabel).length;
121
- assets.push({
122
- folder: path.join(path.basename(paths_default.appBuild), path.dirname(asset.name)),
123
- name: path.basename(asset.name),
124
- size: asset.size,
125
- sizeLabel,
126
- gzipLabel,
127
- sizeLabelLength,
128
- gzipLabelLength
129
- });
130
- gzipLabelLengthList.push(gzipLabelLength);
131
- sizeLabelLengthList.push(sizeLabelLength);
132
- }
133
- assets.sort((a, b) => b.size - a.size);
134
- const longestSizeLabelLength = Math.max.apply(void 0, sizeLabelLengthList);
135
- const longestGzipSizeLabelLength = Math.max.apply(void 0, gzipLabelLengthList);
136
- for (const asset of assets) {
137
- let sizeLabel = asset.sizeLabel;
138
- let gzipLabel = asset.gzipLabel;
139
- const sizeLabelLength = asset.sizeLabelLength;
140
- const gzipLabelLength = asset.gzipLabelLength;
141
- if (sizeLabelLength < longestSizeLabelLength) sizeLabel += " ".repeat(longestSizeLabelLength - sizeLabelLength);
142
- if (gzipLabelLength < longestGzipSizeLabelLength) gzipLabel += " ".repeat(longestGzipSizeLabelLength - gzipLabelLength);
143
- const maxRecommendedSize = asset.name.indexOf("main.") === 0 ? WARN_AFTER_BUNDLE_GZIP_SIZE : WARN_AFTER_CHUNK_GZIP_SIZE;
144
- const isLarge = maxRecommendedSize && asset.size > maxRecommendedSize;
145
- if (isLarge && path.extname(asset.name) === ".js") suggestBundleSplitting = true;
146
- console.log(" " + (isLarge ? styleText("yellow", sizeLabel) : sizeLabel) + " " + gzipLabel, " " + styleText("dim", asset.folder + path.sep) + styleText("cyan", asset.name));
147
- }
148
- }
149
- if (suggestBundleSplitting) {
150
- console.log();
151
- console.log(styleText("yellow", "The bundle size is significantly larger than recommended."));
152
- console.log(styleText("yellow", "You can also analyze the project dependencies: https://goo.gl/LeUzfb"));
153
- }
154
- }
155
- //#endregion
156
- //#region scripts/build.ts
157
- async function startBuild() {
158
- try {
159
- const previousFileSizes = await measureFileSizesBeforeBuild(paths_default.appBuild);
160
- await emptyDirectory(paths_default.appBuild);
161
- await copyPublicFolder();
162
- const stats = await build();
163
- console.log(styleText("green", "Compiled successfully.\n"));
164
- console.log("File sizes after gzip:\n");
165
- if (stats) printFileSizesAfterBuild(stats, previousFileSizes);
166
- console.log();
167
- } catch (error) {
168
- console.log(styleText("red", "Failed to compile.\n"));
169
- if (error && error.message) console.log(error.message);
170
- exit(1);
171
- }
172
- }
173
- function copyPublicFolder() {
174
- return fs.cp(paths_default.appPublic, paths_default.appBuild, {
175
- recursive: true,
176
- filter: (source) => source !== paths_default.appHtml
177
- });
178
- }
179
- /**
180
- * Create the production build and print the deployment instructions.
181
- * @returns
182
- */
183
- async function build() {
184
- console.log("Creating an optimized production build...");
185
- const compiler = rspack(await createRspackConfig());
186
- return new Promise((resolve, reject) => {
187
- compiler.run((error, stats) => {
188
- if (error) return reject(error);
189
- return resolve(stats);
190
- });
191
- });
192
- }
193
- await startBuild();
194
- //#endregion
195
- export {};
1
+ import { t as startBuild } from "../build-DYTkS36_.js";
2
+ export { startBuild };