Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: format code with Prettier and StandardJS #454

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@ export default defineConfig({
'@pages': path.resolve(__dirname, './src/pages'),
'@routers': path.resolve(__dirname, './src/routers'),
'@utils': path.resolve(__dirname, './src/utils'),
'@theme': path.resolve(__dirname, './src/theme'),
},
'@theme': path.resolve(__dirname, './src/theme')
}
},
plugins: [
react({
// Use React plugin in all *.jsx and *.tsx files
include: '**/*.{jsx,tsx}',
include: '**/*.{jsx,tsx}'
}),
svgr(),
visualizer(),
vitePluginImp({
libList: [
{
libName: 'antd',
style: (name) => name !== 'theme' && `antd/es/${name}/style`,
},
],
}),
style: (name) => name !== 'theme' && `antd/es/${name}/style`
}
]
})
// createHtmlPlugin({
// inject: {
// data: {
Expand All @@ -54,20 +54,20 @@ export default defineConfig({
// }),
],
define: {
process, // 解决未定义问题,推荐 import.meta.env
process // 解决未定义问题,推荐 import.meta.env
},
css: {
modules: {
scopeBehaviour: 'local',
scopeBehaviour: 'local'
},
preprocessorOptions: {
less: {
javascriptEnabled: true,
modifyVars: {
'@primary-color': '#4377FE', // 设置antd主题色
},
},
},
'@primary-color': '#4377FE' // 设置antd主题色
}
}
}
},
server: {
open: true,
Expand All @@ -77,47 +77,47 @@ export default defineConfig({
pathRewrite: { '^/faker': '' },
secure: false,
changeOrigin: true,
cookieDomainRewrite: 'localhost',
cookieDomainRewrite: 'localhost'
},
'/wkylin': {
// target: 'https://jsonplaceholder.typicode.com',
// target: service[env.proxy] // --env.proxy=test
target: 'https://my-json-server.typicode.com',
// pathRewrite: { '^/wkylin': '/wkylin' },
secure: false,
changeOrigin: true,
changeOrigin: true
},
'/v2': {
target: 'https://www.mocky.io',
secure: false,
changeOrigin: true,
},
},
changeOrigin: true
}
}
},
// 去除console和debugger
esbuild: {
pure: ['console.log', 'debugger'],
pure: ['console.log', 'debugger']
},
build: {
sourcemap: true,
write: true,
rollupOptions: {
// external: [],
output: {
manualChunks(id) {
manualChunks (id) {
if (id.includes('node_modules')) {
return id.toString().split('node_modules/')[1].split('/')[0].toString()
}
},
}
// chunkFileNames: (chunkInfo) => {
// const facadeModuleId = chunkInfo.facadeModuleId ? chunkInfo.facadeModuleId.split('/') : []
// const fileName = facadeModuleId[facadeModuleId.length - 2] || '[name]'
// return `js/${fileName}/[name].[hash].js`
// },
},
},
}
}
},
preview: {
port: 4173,
},
port: 4173
}
})
Loading