-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
App.vue cannot be overwritten or customized using vue-cli presets #5106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
your template render order is I have another workaround, modify the preset.json like this {
"useConfigFiles": true,
"plugins": {
"@vue/cli-plugin-babel": {},
"@vue/cli-plugin-eslint": {
"config": "prettier",
"lintOn": [
"save"
]
},
+ "@vue/cli-plugin-router": {
+ "historyMode": true
+ }
},
- "router": true, // legacy support
- "routerHistoryMode": true,
"vuex": true,
"cssPreprocessor": "dart-sass"
} this preset leads to expected render order. releated code. maybe Vue CLI needs another |
Thank you very much fangbinwei for your advice, I'll try that out. My actual preset is the one I've saved using At least, there should be some warning about rendering order in the official guide, and at best vue-cli (or vue-router?) should save the presets like the examples given at https://cli.vuejs.org/guide/plugins-and-presets.html#presets Also just my personal opinion ;) |
I agree, rendering order should be mentioned in document. ✋And I guess you generated preset by vue cli 3? I tested version 4.1.2, it works. |
Yes, I generated it using vue-cli 3 and reused it for vue-cli 4. My preset maybe worked correctly for vue-cli 3, but I only created a customized App.vue file very recently (to use with vue-cli 4). |
Bump on this. I'm running into the same issue except with the vuetify cli plugin. I wish there could be a way to manually specify at what point the generator template (or certain files within it) get copied over |
Version
4.1.2
Reproduction link
https://github.com/tbl0605/vue-cli-plugin-preset-bug-demo
Environment info
Steps to reproduce
create a new project using:
What is expected?
The file src/App.vue in project vue-demo-app should be overwritten by file generator/template/src/App.vue from preset vue-cli-plugin-preset-bug-demo
This problem does not occur with any other file that I'll add to directory generator/template/
What is actually happening?
The content of the file src/App.vue in project vue-demo-app will exclusively be based on the file App.vue from @vue/cli-service without taking account of generator/template/src/App.vue from preset vue-cli-plugin-preset-bug-demo
I tested with other presets found on github and the same problem occurred with their App.vue files.
When I create a new project using following commands, everything works as expected:
I can also workaround this problem in preset vue-cli-plugin-preset-bug-demo by renaming generator/template/src/App.vue as generator/template/src/App.tmpl.vue and by adding a hook in generator/index.js to write App.tmpl.vue back to App.vue:
The text was updated successfully, but these errors were encountered: