fix(build): esbuild transform vue sfc (#5602)

This commit is contained in:
三咲智子 2022-01-24 23:31:08 +08:00 committed by GitHub
parent fec3d0c69d
commit 3c16321110
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -21,6 +21,7 @@ import {
import { withTaskName } from './utils/gulp'
import { EP_BRAND_NAME } from './utils/constants'
import { target } from './build-info'
import type { Plugin } from 'rollup'
const banner = `/*! ${EP_BRAND_NAME} v${version} */\n`
@ -31,7 +32,7 @@ async function buildFullEntry(minify: boolean) {
ElementPlusAlias(),
vue({
isProduction: true,
}),
}) as Plugin,
nodeResolve({
extensions: ['.mjs', '.js', '.json', '.ts'],
}),
@ -40,6 +41,9 @@ async function buildFullEntry(minify: boolean) {
minify,
sourceMap: minify,
target,
loaders: {
'.vue': 'ts',
},
}),
replace({
'process.env.NODE_ENV': JSON.stringify('production'),

View File

@ -37,6 +37,9 @@ export const buildModules = async () => {
esbuild({
sourceMap: true,
target,
loaders: {
'.vue': 'ts',
},
}),
filesize({ reporter }),
],