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,
renderLegacyChunks: false,
targets,
...api.config.viteLegacy,
}),
splitVendorChunkPlugin(),
],

View File

@ -5,33 +5,39 @@ import { defineBuildConfig } from '@fesjs/fes';
export default defineBuildConfig({
proxy: {
'/v2': {
'target': 'https://api.douban.com/',
'changeOrigin': true,
}
target: 'https://api.douban.com/',
changeOrigin: true,
},
},
publicPath: '/',
html: {
title: '拉夫德鲁'
viteOption: {
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
export default {
request: {
base: '/api'
}
};
export default {};

View File

@ -39,14 +39,12 @@
"publishConfig": {
"access": "public"
},
"devDependencies": {
"@ttou/postcss-px-to-viewport": "1.1.4"
},
"dependencies": {
"@ttou/postcss-px-to-viewport": "1.1.4",
"@fesjs/fes": "^3.0.0-rc.0",
"@fesjs/plugin-icon": "^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"
},
"private": true

View File

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