fix: 修复 vite html 配置问题 (#200)

* fix: 修复 vite html 配置问题

* chore: lock @babel/preset-env
This commit is contained in:
qlin 2023-06-16 11:11:11 +08:00 committed by GitHub
parent 55bbf2fcbf
commit 2f11e29cfc
5 changed files with 24 additions and 15 deletions

View File

@ -36,7 +36,9 @@ export function getInnerCommonConfig(api) {
vue(api.config.viteVuePlugin || {}),
SFCConfigBlockPlugin,
vueJsx(api.config.viteVueJsx || {}),
createHtmlPlugin({
createHtmlPlugin(
deepmerge(
{
minify: true,
// 使用绝对地址在win下会提示没有权限
entry: `/src/${api.paths.tmpDir}/fes.js`,
@ -48,7 +50,10 @@ export function getInnerCommonConfig(api) {
mountElementId: api.config.mountElementId,
},
},
}),
},
api.config.viteHtml,
),
),
],
resolve: {
alias: {

View File

@ -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'),

View File

@ -32,7 +32,7 @@
"@babel/plugin-proposal-function-bind": "^7.18.9",
"@babel/plugin-proposal-pipeline-operator": "^7.18.9",
"@babel/plugin-transform-runtime": "^7.21.0",
"@babel/preset-env": "^7.20.2",
"@babel/preset-env": "7.20.2",
"@babel/preset-typescript": "^7.21.0",
"@fesjs/utils": "^3.0.0",
"@vue/babel-plugin-jsx": "^1.1.1",

View File

@ -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'],

2
pnpm-lock.yaml generated
View File

@ -193,7 +193,7 @@ importers:
specifier: ^7.21.0
version: 7.21.0(@babel/core@7.21.3)
'@babel/preset-env':
specifier: ^7.20.2
specifier: 7.20.2
version: 7.20.2(@babel/core@7.21.3)
'@babel/preset-typescript':
specifier: ^7.21.0