build:resolve template assets reference on build (94b3899), closes#15 copy sfc descriptor to prevent caching issues (#9) (0e13938) deps:movevue-template-compilerto peerDependencies (4de9cb8) dev:script gencode should place top to reflect sourcemap (#8) (6ea995d) disable vite internalrollu...
add vueTemplateCompiler option (3274c05), closes #76 add allowDeclareFields for babel ts option (#120) (798953a) custom block (19f7274) default compilerOptions: whitespace: 'condense' (#62) (ab62cce) determine preprocessLang at template block (#42) (c206f88) dev: assets handling (71c768...
// vite.config.jsimport{createVuePlugin}from'vite-plugin-vue2'exportdefault{plugins:[createVuePlugin(/* options */)],} Options vueTemplateOptions Type:Object Default:{ compilerOptions :{ whitespace: 'condense' } } Note { whitespace: 'condense' } behavior ...
export interface Options { include?: string | RegExp | (string | RegExp)[] exclude?: string | RegExp | (string | RegExp)[] isProduction?: boolean // options to pass on to vue/compiler-sfc script?: Partial<Pick<SFCScriptCompileOptions, 'babelParserPlugins'>> template?: Partial< Pick...
{ "vite": "^2.0.0 || ^3.0.0 || ^4.0.0", "vue-template-compiler": "^2.2.0" }, "dependencies": { "@babel/core": "^7.17.9", "@babel/parser": "^7.17.9", "@babel/plugin-proposal-class-properties": "^7.16.7", "@babel/plugin-proposal-decorators": "^7.17.9", "@babel/...
我们可以在@vue/compiler-sfc模板编译后的代码中,通过正则替换文本值,例如模板代码为: importVButtonfrom'./components/VButton.vue'<template><v-buttonprepend-icon="mdi-delete">按钮</v-button></template> 模板会编译成 function_sfc_render(_ctx,_cache,$props,$setup,$data,$options){return(_openBlock...
摘要:公司后台项目基于@花裤衩大神的vue-element-admin,随着项目功能的不断完善和需求不断增加,项目启动也变的越来越慢。慢到什么程度呢?我i7-10代16G内存的本本跑项目最快也需要近3分钟,实在难以忍受。几经折腾,终于成功改造成了vite。现在跑项目,5秒内即可跑起来,简直不要太爽!此次改造的过程遇到很多问题,现将...
需要最后达到的使用目的 {代码...} 以下为原理介绍,如跳过直接查看 vite-plugin-iconify 。先创建一个 VIcon 组件假设我们首先封装一个 v-icon 组件在 src/c...
vueTemplateOptions Type:Object Default:{ compilerOptions :{ whitespace: 'condense' } } Note { whitespace: 'condense' } behavior A whitespace-only text node between element tags is removed if it contains new lines. Otherwise, it is condensed into a single space. ...
According to the Vue upgrade workflow it's possible to make it work with Vue2. However when I follow the steps (especially removing the template compiler and replacing it with @vue/compiler-sfc). I get the following error failed to load ...