upload project source code
This commit is contained in:
52
前端源码/uni-app/vite.config.ts
Normal file
52
前端源码/uni-app/vite.config.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import { resolve } from 'path'
|
||||
import postcssRpxToVw from './postcss-rpx-to-vw.js'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
vue({
|
||||
template: {
|
||||
compilerOptions: {
|
||||
// 将 uni-app 的组件标签视为自定义元素
|
||||
isCustomElement: (tag) => {
|
||||
return [
|
||||
'view',
|
||||
'text',
|
||||
'image',
|
||||
'scroll-view',
|
||||
'swiper',
|
||||
'swiper-item',
|
||||
'input',
|
||||
'textarea',
|
||||
'button',
|
||||
'picker',
|
||||
'picker-view',
|
||||
'picker-view-column'
|
||||
].includes(tag)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
],
|
||||
css: {
|
||||
postcss: {
|
||||
plugins: [
|
||||
postcssRpxToVw()
|
||||
]
|
||||
}
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': resolve(__dirname, '.'),
|
||||
},
|
||||
},
|
||||
server: {
|
||||
port: 3000,
|
||||
host: true,
|
||||
},
|
||||
build: {
|
||||
outDir: 'dist',
|
||||
assetsDir: 'assets',
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user