fix: 修复 viteLegacy 配置问题

This commit is contained in:
winixt 2022-11-24 14:54:22 +08:00
parent b6ba33df6e
commit aec267f83f
5 changed files with 37 additions and 37 deletions

View File

@ -37,6 +37,7 @@ export default async (api) => {
modernPolyfills: true, modernPolyfills: true,
renderLegacyChunks: false, renderLegacyChunks: false,
targets, targets,
...api.config.viteLegacy,
}), }),
splitVendorChunkPlugin(), splitVendorChunkPlugin(),
], ],

View File

@ -5,33 +5,39 @@ import { defineBuildConfig } from '@fesjs/fes';
export default defineBuildConfig({ export default defineBuildConfig({
proxy: { proxy: {
'/v2': { '/v2': {
'target': 'https://api.douban.com/', target: 'https://api.douban.com/',
'changeOrigin': true, changeOrigin: true,
} },
}, },
publicPath: '/', publicPath: '/',
html: { viteOption: {
title: '拉夫德鲁' css: {
postcss: {
plugins: [
pxtoviewport({
unitToConvert: 'px',
viewportWidth: 375,
unitPrecision: 5,
propList: ['*'],
viewportUnit: 'vw',
fontViewportUnit: 'vw',
selectorBlackList: [],
minPixelValue: 1,
mediaQuery: false,
replace: true,
exclude: [],
landscape: false,
landscapeUnit: 'vw',
}),
],
},
},
build: {
target: 'es2015',
},
},
targets: {
chrome: 61,
ios: 11,
}, },
extraPostCSSPlugins: [
pxtoviewport({
unitToConvert: 'px',
viewportWidth: 375,
unitPrecision: 5,
propList: ['*'],
viewportUnit: 'vw',
fontViewportUnit: 'vw',
selectorBlackList: [],
minPixelValue: 1,
mediaQuery: false,
replace: true,
exclude: [],
landscape: false,
landscapeUnit: 'vw'
})
],
devServer: {
port: 8000
}
}); });

View File

@ -1,8 +1,3 @@
// .fes.js 只负责管理编译时配置只能使用plain Object // .fes.js 只负责管理编译时配置只能使用plain Object
export default {};
export default {
request: {
base: '/api'
}
};

View File

@ -39,14 +39,12 @@
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
}, },
"devDependencies": {
"@ttou/postcss-px-to-viewport": "1.1.4"
},
"dependencies": { "dependencies": {
"@ttou/postcss-px-to-viewport": "1.1.4",
"@fesjs/fes": "^3.0.0-rc.0", "@fesjs/fes": "^3.0.0-rc.0",
"@fesjs/plugin-icon": "^3.0.0-rc.0", "@fesjs/plugin-icon": "^3.0.0-rc.0",
"@fesjs/plugin-request": "^3.0.0-rc.0", "@fesjs/plugin-request": "^3.0.0-rc.0",
"@fesjs/builder-webpack": "^3.0.0-rc.0", "@fesjs/builder-vite": "^3.0.0-rc.1",
"vue": "^3.2.37" "vue": "^3.2.37"
}, },
"private": true "private": true

View File

@ -1,7 +1,7 @@
import { defineRuntimeConfig } from '@fesjs/fes'; import { defineRuntimeConfig } from '@fesjs/fes';
export default defineRuntimeConfig({ export default defineRuntimeConfig({
request: {}, // request: {},
}); });
// export default defineRuntimeConfig({ // export default defineRuntimeConfig({