@moluoxixi/vite-config 0.0.30 → 0.0.32
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/es/index.mjs +2 -3
- package/es/src/index.d.ts +1 -1
- package/lib/index.cjs +2 -3
- package/lib/src/index.d.ts +1 -1
- package/package.json +1 -1
package/es/index.mjs
CHANGED
|
@@ -171,9 +171,8 @@ function addScopedAndReplacePrefixPlugin({
|
|
|
171
171
|
}
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
|
-
async function getViteConfig(Config, params) {
|
|
175
|
-
const
|
|
176
|
-
const config = configResult;
|
|
174
|
+
async function getViteConfig(Config = {}, params) {
|
|
175
|
+
const config = typeof Config === "function" ? Config(params) : Config;
|
|
177
176
|
const { mode = "base" } = params || {};
|
|
178
177
|
const rootPath = config.rootPath || process.cwd();
|
|
179
178
|
const modeConfig = config.mode || {};
|
package/es/src/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigEnv } from 'vite';
|
|
2
2
|
import { ViteConfigType } from './_types/index.ts';
|
|
3
|
-
declare function getViteConfig(Config
|
|
3
|
+
declare function getViteConfig(Config?: ViteConfigType, params?: ConfigEnv): Promise<Record<string, any>>;
|
|
4
4
|
declare function createViteConfig(Config: ViteConfigType): import('vite').UserConfigFnPromise;
|
|
5
5
|
export { createViteConfig, getViteConfig, };
|
|
6
6
|
export default createViteConfig;
|
package/lib/index.cjs
CHANGED
|
@@ -194,9 +194,8 @@ function addScopedAndReplacePrefixPlugin({
|
|
|
194
194
|
}
|
|
195
195
|
};
|
|
196
196
|
}
|
|
197
|
-
async function getViteConfig(Config, params) {
|
|
198
|
-
const
|
|
199
|
-
const config = configResult;
|
|
197
|
+
async function getViteConfig(Config = {}, params) {
|
|
198
|
+
const config = typeof Config === "function" ? Config(params) : Config;
|
|
200
199
|
const { mode = "base" } = params || {};
|
|
201
200
|
const rootPath = config.rootPath || process.cwd();
|
|
202
201
|
const modeConfig = config.mode || {};
|
package/lib/src/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigEnv } from 'vite';
|
|
2
2
|
import { ViteConfigType } from './_types/index.ts';
|
|
3
|
-
declare function getViteConfig(Config
|
|
3
|
+
declare function getViteConfig(Config?: ViteConfigType, params?: ConfigEnv): Promise<Record<string, any>>;
|
|
4
4
|
declare function createViteConfig(Config: ViteConfigType): import('vite').UserConfigFnPromise;
|
|
5
5
|
export { createViteConfig, getViteConfig, };
|
|
6
6
|
export default createViteConfig;
|