feat(@vant/cli): support custom script extentions (#10624)

* feat(@vant/cli): support custom script extentions

* fix: extensionsMap
This commit is contained in:
neverland
2022-05-22 19:57:16 +08:00
committed by GitHub
parent 0c0191332a
commit 173a364dae
2 changed files with 8 additions and 4 deletions
+4 -2
View File
@@ -14,7 +14,9 @@ export function getViteConfigForPackage({
}): InlineConfig {
setBuildTarget('package');
const { name } = getVantConfig();
const { name, build } = getVantConfig();
const entryExtension = build?.extensions?.esm || '.js';
const entry = join(ES_DIR, `index${entryExtension}`);
return {
root: CWD,
@@ -24,7 +26,7 @@ export function getViteConfigForPackage({
build: {
lib: {
name,
entry: join(ES_DIR, 'index.js'),
entry,
formats,
fileName: (format: string) => {
const suffix = format === 'umd' ? '' : `.${format}`;