Skip to content

Commit

Permalink
fix: 修复 viteLegacy 配置问题
Browse files Browse the repository at this point in the history
  • Loading branch information
winixt committed Nov 24, 2022
1 parent f7c497d commit 5eeb100
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default async (api) => {
modernPolyfills: true,
renderLegacyChunks: false,
targets,
...api.config.viteLegacy,
}),
splitVendorChunkPlugin(),
],
Expand Down
58 changes: 32 additions & 26 deletions packages/fes-template-h5/.fes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
});

7 changes: 1 addition & 6 deletions packages/fes-template-h5/.fes.prod.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
// .fes.js 只负责管理编译时配置,只能使用plain Object


export default {
request: {
base: '/api'
}
};
export default {};
6 changes: 2 additions & 4 deletions packages/fes-template-h5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/fes-template-h5/src/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineRuntimeConfig } from '@fesjs/fes';

export default defineRuntimeConfig({
request: {},
// request: {},
});

// export default defineRuntimeConfig({
Expand Down

0 comments on commit 5eeb100

Please sign in to comment.