@vixt/core 0.1.12 → 0.1.14
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.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.mjs +13 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -78,6 +78,9 @@ declare function defineVixtConfig(input: VixtOptions): VixtOptions;
|
|
|
78
78
|
declare function loadVixtConfig(opts?: LoadConfigOptions<VixtOptions>): Promise<c12.ResolvedConfig<VixtOptions, c12.ConfigLayerMeta>>;
|
|
79
79
|
declare function resolveLayersDirs(layers: VixtConfigLayer[] | undefined, config: VixtOptions): Record<string, string[] | undefined>;
|
|
80
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Load workspace and cwd env variables by default
|
|
83
|
+
*/
|
|
81
84
|
declare function loadEnv(mode?: string, envDir?: string, prefixes?: string | string[]): ImportMeta["env"];
|
|
82
85
|
|
|
83
86
|
declare function defineVitePlugin<Options = any>(pluginFn: (options?: Options) => PluginOption): (options?: Options) => PluginOption;
|
package/dist/index.d.ts
CHANGED
|
@@ -78,6 +78,9 @@ declare function defineVixtConfig(input: VixtOptions): VixtOptions;
|
|
|
78
78
|
declare function loadVixtConfig(opts?: LoadConfigOptions<VixtOptions>): Promise<c12.ResolvedConfig<VixtOptions, c12.ConfigLayerMeta>>;
|
|
79
79
|
declare function resolveLayersDirs(layers: VixtConfigLayer[] | undefined, config: VixtOptions): Record<string, string[] | undefined>;
|
|
80
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Load workspace and cwd env variables by default
|
|
83
|
+
*/
|
|
81
84
|
declare function loadEnv(mode?: string, envDir?: string, prefixes?: string | string[]): ImportMeta["env"];
|
|
82
85
|
|
|
83
86
|
declare function defineVitePlugin<Options = any>(pluginFn: (options?: Options) => PluginOption): (options?: Options) => PluginOption;
|
package/dist/index.mjs
CHANGED
|
@@ -458,11 +458,18 @@ const typescript = defineVixtModule({
|
|
|
458
458
|
function loadEnv(mode, envDir, prefixes) {
|
|
459
459
|
const parsedArgv = cac().parse();
|
|
460
460
|
mode = mode || parsedArgv.options.mode || parsedArgv.options.m || env.NODE_ENV;
|
|
461
|
+
const loadedEnv = {};
|
|
462
|
+
if (envDir) {
|
|
463
|
+
Object.assign(loadedEnv, loadEnv$1(mode, envDir, prefixes));
|
|
464
|
+
} else {
|
|
465
|
+
const workspaceDir = env.INIT_CWD;
|
|
466
|
+
Object.assign(loadedEnv, loadEnv$1(mode, workspaceDir, prefixes), loadEnv$1(mode, cwd(), prefixes));
|
|
467
|
+
}
|
|
461
468
|
return {
|
|
462
469
|
MODE: mode,
|
|
463
470
|
DEV: env.NODE_ENV !== "production",
|
|
464
471
|
PROD: env.NODE_ENV === "production",
|
|
465
|
-
...
|
|
472
|
+
...loadedEnv
|
|
466
473
|
};
|
|
467
474
|
}
|
|
468
475
|
|
|
@@ -472,6 +479,11 @@ async function loadVixt(opts) {
|
|
|
472
479
|
modules: [alias, app, config, typescript]
|
|
473
480
|
}
|
|
474
481
|
}));
|
|
482
|
+
const parsedArgv = cac().parse();
|
|
483
|
+
const isForce = !!parsedArgv.options.force;
|
|
484
|
+
if (isForce) {
|
|
485
|
+
fs.removeSync(result.config.buildDir);
|
|
486
|
+
}
|
|
475
487
|
const layerModules = await applyLayerModules(result.layers ?? [], result.config);
|
|
476
488
|
const vixt = {
|
|
477
489
|
options: result.config,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vixt/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.14",
|
|
5
5
|
"author": "SoulLyoko<https://github.com/SoulLyoko>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/SoulLyoko/vixt#readme",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"mlly": "1.7.1",
|
|
35
35
|
"pathe": "^1.1.2",
|
|
36
36
|
"pkg-types": "^1.2.0",
|
|
37
|
-
"tsx": "^4.
|
|
37
|
+
"tsx": "^4.19.0",
|
|
38
38
|
"vite": "^5.4.2",
|
|
39
39
|
"vite-plugin-checker": "^0.7.2",
|
|
40
40
|
"vue-tsc": "2.0.26"
|