官方文档在这里:https://vitejs.dev/config/
让 Vue 认出 html 原生的 marquee 标签
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
export default () => {
return defineConfig({
plugins: [
vue({
template: {
compilerOptions: {
isCustomElement: (tag) => ['marquee'].includes(tag), // vue3 居然不认识 marquee
},
},
}),
],
});
};
yarn build 后再做些什么
import { defineConfig } from 'vite';
export default ({ mode }) => {
return defineConfig({
plugins: [
{
name: 'build-end',
buildEnd(error) {
if (mode == 'production') {
console.log('编译完成。', error || '');
}
},
closeBundle() {
if (mode == 'production') {
console.log('打包完成');
}
},
},
],
});
};