代码拉取完成,页面将自动刷新
/// <reference types="vitest" />
import { type ConfigEnv, defineConfig, type UserConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import path from 'path'
import config from './package.json'
import autoprefixer from 'autoprefixer'
import VueDevTools from 'vite-plugin-vue-devtools'
import { markdown } from '@nutui/vite-plugins'
const resolve = path.resolve
// https://vitejs.dev/config/
export default defineConfig((env: ConfigEnv) => ({
base: env.command === 'build' ? '/h5/vue/4x/' : '/',
resolve: {
alias: [
{ find: '@', replacement: resolve(__dirname, './src') },
{ find: '@nutui/nutui', replacement: resolve(__dirname, './src/packages/index.ts') }
]
},
css: {
preprocessorOptions: {
scss: {
// example : additionalData: `@import "./src/design/styles/variables";`
// dont need include file extend .scss
additionalData: `@import "@/packages/styles/variables.scss";@import "@/sites/assets/styles/variables.scss";`
}
},
postcss: {
plugins: [
autoprefixer({
overrideBrowserslist: ['> 0.5%', 'last 2 versions', 'ie > 11', 'iOS >= 10', 'Android >= 5']
})
]
}
},
plugins: [
VueDevTools(),
vue({
include: [/\.vue$/, /\.md$/]
}),
vueJsx(),
markdown({
docRoot: path.resolve(__dirname, './src/packages/__VUE'),
docTaroRoot: path.resolve(__dirname, './packages/nutui-taro-demo/src')
})
],
build: {
target: 'es2015',
outDir: './dist/h5/vue/4x/',
// assetsDir: config.version,
cssCodeSplit: false,
cssTarget: ['chrome61'],
rollupOptions: {
input: {
// doc: resolve(__dirname, 'index.html'),
mobile: resolve(__dirname, 'demo.html')
},
output: {
entryFileNames: `demo-${config.version}/[name].js`,
chunkFileNames: `demo-${config.version}/[name].js`,
assetFileNames: `demo-${config.version}/[name].[ext]`,
plugins: []
}
}
},
test: {
globals: true,
environment: 'happy-dom',
coverage: {
all: false,
provider: 'v8'
},
include: ['src/packages/__VUE/**/*.(test|spec).(ts|tsx)'],
reporters: ['default', 'html']
}
}) as UserConfig)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。