@evjs/cli 0.2.0 → 0.2.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.d.ts +2 -2
- package/dist/index.js +8 -2
- package/dist/load-config.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ import { type BuildOptions, type BundlerAdapter, type Config, type DevOptions }
|
|
|
3
3
|
export { type BuildOptions, type BuildResult, type BundlerAdapter, type BundlerCtx, type ClientManifest, CONFIG_DEFAULTS, type Config, type DevOptions, defineConfig, type EvBuildResult, type EvBundlerCtx, type EvConfig, type EvDocument, type EvPlugin, type EvPluginConfigContext, type EvPluginContext, type EvPluginHooks, type Plugin, type PluginContext, type PluginHooks, type ResolvedConfig, type ResolvedEvConfig, resolveConfig, type ServerManifest, } from "@evjs/ev";
|
|
4
4
|
export { loadConfig } from "./load-config.js";
|
|
5
5
|
export type DefaultBundlerConfig = typeof utoopackAdapter extends BundlerAdapter<infer TBundlerCfg> ? TBundlerCfg : never;
|
|
6
|
-
export declare function dev(userConfig?: Config<
|
|
7
|
-
export declare function build(userConfig?: Config<
|
|
6
|
+
export declare function dev<TBundlerCfg = DefaultBundlerConfig>(userConfig?: Config<TBundlerCfg>, options?: DevOptions<TBundlerCfg>): Promise<void>;
|
|
7
|
+
export declare function build<TBundlerCfg = DefaultBundlerConfig>(userConfig?: Config<TBundlerCfg>, options?: BuildOptions<TBundlerCfg>): Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -6,15 +6,21 @@ const defaultBundler = utoopackAdapter;
|
|
|
6
6
|
export async function dev(userConfig, options) {
|
|
7
7
|
const { loadConfig } = await import("./load-config.js");
|
|
8
8
|
const defaultLoadConfig = (loadConfig);
|
|
9
|
+
const bundler = options?.bundler ??
|
|
10
|
+
userConfig?.bundler ??
|
|
11
|
+
defaultBundler;
|
|
9
12
|
await frameworkDev(userConfig, {
|
|
10
13
|
...options,
|
|
11
|
-
bundler
|
|
14
|
+
bundler,
|
|
12
15
|
loadConfig: options?.loadConfig ?? defaultLoadConfig,
|
|
13
16
|
});
|
|
14
17
|
}
|
|
15
18
|
export async function build(userConfig, options) {
|
|
19
|
+
const bundler = options?.bundler ??
|
|
20
|
+
userConfig?.bundler ??
|
|
21
|
+
defaultBundler;
|
|
16
22
|
await frameworkBuild(userConfig, {
|
|
17
23
|
...options,
|
|
18
|
-
bundler
|
|
24
|
+
bundler,
|
|
19
25
|
});
|
|
20
26
|
}
|
package/dist/load-config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Config } from "@evjs/ev";
|
|
1
|
+
import type { Config, DefaultBundlerConfig } from "@evjs/ev";
|
|
2
2
|
export declare const CONFIG_FILES: string[];
|
|
3
3
|
/**
|
|
4
4
|
* Load evjs config from the project root.
|
|
@@ -6,5 +6,5 @@ export declare const CONFIG_FILES: string[];
|
|
|
6
6
|
* Looks for `ev.config.ts`, `.js`, or `.mjs` in the given directory.
|
|
7
7
|
* Returns undefined if no config file is found.
|
|
8
8
|
*/
|
|
9
|
-
export declare function loadConfig<TBundlerCfg =
|
|
9
|
+
export declare function loadConfig<TBundlerCfg = DefaultBundlerConfig>(cwd: string): Promise<Config<TBundlerCfg> | undefined>;
|
|
10
10
|
export declare function resolveConfigPath(cwd: string): string | undefined;
|