buner 1.0.8 → 1.0.9
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/buner.js +14 -2
- package/package.json +1 -1
- package/xpack/paths.ts +3 -2
package/dist/buner.js
CHANGED
|
@@ -35,7 +35,7 @@ import "js-beautify";
|
|
|
35
35
|
import "node:crypto";
|
|
36
36
|
import "lodash";
|
|
37
37
|
const name = "buner";
|
|
38
|
-
const version = "1.0.
|
|
38
|
+
const version = "1.0.9";
|
|
39
39
|
const description = "Frontend build toolkit for Vite + React SSR projects — SCSS pipeline, prerender, SSR dev server, and backend integration.";
|
|
40
40
|
const type = "module";
|
|
41
41
|
const license = "MIT";
|
|
@@ -455,6 +455,10 @@ const packageName = "buner";
|
|
|
455
455
|
const packageDir = path.dirname(fileURLToPath(import.meta.url));
|
|
456
456
|
const viteConfigPath = () => path.resolve(packageDir, "..", "vite.config.ts");
|
|
457
457
|
const viteBuild = async (opts) => {
|
|
458
|
+
const prevMode = process.env.BUNER_MODE;
|
|
459
|
+
if (opts.mode) {
|
|
460
|
+
process.env.BUNER_MODE = opts.mode;
|
|
461
|
+
}
|
|
458
462
|
const config = {
|
|
459
463
|
configFile: viteConfigPath(),
|
|
460
464
|
build: {
|
|
@@ -466,7 +470,15 @@ const viteBuild = async (opts) => {
|
|
|
466
470
|
if (opts.mode) {
|
|
467
471
|
config.mode = opts.mode;
|
|
468
472
|
}
|
|
469
|
-
|
|
473
|
+
try {
|
|
474
|
+
await build(config);
|
|
475
|
+
} finally {
|
|
476
|
+
if (prevMode === void 0) {
|
|
477
|
+
delete process.env.BUNER_MODE;
|
|
478
|
+
} else {
|
|
479
|
+
process.env.BUNER_MODE = prevMode;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
470
482
|
};
|
|
471
483
|
const onPromptState = (state) => {
|
|
472
484
|
if (state?.aborted) {
|
package/package.json
CHANGED
package/xpack/paths.ts
CHANGED
|
@@ -6,9 +6,10 @@ import { loadEnv } from 'vite';
|
|
|
6
6
|
|
|
7
7
|
const argvModeIndex = process.argv.indexOf('--mode');
|
|
8
8
|
const mode =
|
|
9
|
-
|
|
9
|
+
process.env.BUNER_MODE ??
|
|
10
|
+
(argvModeIndex >= 0 && argvModeIndex < process.argv.length - 1 && !process.argv[argvModeIndex + 1].startsWith('-')
|
|
10
11
|
? process.argv[argvModeIndex + 1]
|
|
11
|
-
: 'production';
|
|
12
|
+
: 'production');
|
|
12
13
|
|
|
13
14
|
// Consumer project root — where buner commands are run
|
|
14
15
|
export const root = slash(process.cwd());
|