mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-05 19:41:57 +08:00
fix: 修复 vite html 配置问题
This commit is contained in:
parent
6b6e703c54
commit
8df71ca738
@ -36,19 +36,24 @@ export function getInnerCommonConfig(api) {
|
||||
vue(api.config.viteVuePlugin || {}),
|
||||
SFCConfigBlockPlugin,
|
||||
vueJsx(api.config.viteVueJsx || {}),
|
||||
createHtmlPlugin({
|
||||
minify: true,
|
||||
// 使用绝对地址在win下会提示没有权限
|
||||
entry: `/src/${api.paths.tmpDir}/fes.js`,
|
||||
template: 'index.html',
|
||||
inject: {
|
||||
data: {
|
||||
...resolveRuntimeEnv(publicPath),
|
||||
title: api.config.title || 'Fes.js',
|
||||
mountElementId: api.config.mountElementId,
|
||||
createHtmlPlugin(
|
||||
deepmerge(
|
||||
{
|
||||
minify: true,
|
||||
// 使用绝对地址在win下会提示没有权限
|
||||
entry: `/src/${api.paths.tmpDir}/fes.js`,
|
||||
template: 'index.html',
|
||||
inject: {
|
||||
data: {
|
||||
...resolveRuntimeEnv(publicPath),
|
||||
title: api.config.title || 'Fes.js',
|
||||
mountElementId: api.config.mountElementId,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}),
|
||||
api.config.viteHtml,
|
||||
),
|
||||
),
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
|
@ -6,6 +6,7 @@ export default function () {
|
||||
require.resolve('./registerType'),
|
||||
|
||||
// bundle configs
|
||||
require.resolve('./features/viteHtml'),
|
||||
require.resolve('./features/viteOption'),
|
||||
require.resolve('./features/viteVueJsx'),
|
||||
require.resolve('./features/viteVuePlugin'),
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { defineBuildConfig } from '@fesjs/fes';
|
||||
|
||||
export default defineBuildConfig({
|
||||
builder: 'webpack',
|
||||
builder: 'vite',
|
||||
define: {
|
||||
__DEV__: false,
|
||||
},
|
||||
@ -71,6 +71,9 @@ export default defineBuildConfig({
|
||||
['1', '有效的'],
|
||||
],
|
||||
},
|
||||
viteHtml: {
|
||||
template: 'hello.html',
|
||||
},
|
||||
dynamicImport: true,
|
||||
monacoEditor: {
|
||||
languages: ['javascript', 'typescript', 'html', 'json'],
|
||||
|
Loading…
x
Reference in New Issue
Block a user