Reputation: 1473
npm run dev
executes very fast.
When I add 1000 rows of html (header) to a .vue file (template), it takes 9 minutes to compile.
Question:
Does vue.js not support such a lengthy template?
Is there any way to speed up?
<template>
<header class="..." >
... (1000 rows)
</header>
</template>
<script>
export default {
name: 'Header'
}
</script>
Upvotes: 1
Views: 3838
Reputation: 601
This is caused by prettier eslint.
Solution
Follow this steps to fix it.
goto /node_modules/vue-loader/lib/template-compiler/index.js lines 78:81
Change
if (!isProduction) {
code = prettier.format(code, { semi: false })
}
to
// if (!isProduction) {
// code = prettier.format(code, { semi: false })
// }
Upvotes: 1
Reputation: 2109
Because you are using a static template with static 1000 html elements. Use v-for!
What it will do is just compile (not run!) the Vue syntax on <template>
.
Check this out as well: One Useful Link on Rows Rendering on Different Frameworks
Upvotes: 1