Open steveworkman opened 5 years ago
I am also trying to use my own vue-cli-preset, which edits the provided base template by replacing the favicon.ico
like:
---
extend: '@vue/cli-service/generator/template/public/index.html'
replace: !!js/regexp /favicon.ico/
---
favicon.png
But my own preset of course has no node_modules
and therefor cannot find the template modules leading into this error:
Error: Cannot find module '@vue/cli-service/generator/template/public/index.html' from 'C:\...\AppData\Local\Temp\vue-cli-presets\vue-cli-preset.git\template\public'
As Steve already mentioned, the context is false, from where the module should be resolved...
@steveworkman have you found a solution for yourself?
I cheated and copy/pasted the whole file. This is not a good idea or sustainable
What problem does this feature solve?
Presets can contain generators, and can add files to be rendered. However, because they are run from within the context of the preset itself, they are unable to extend other files using https://cli.vuejs.org/dev-guide/plugin-dev.html#editing-existing-templates
This is because the base directory for file resolution is set to be the current named file context, so the template to be overridden cannot be resolved.
Can presets gain the ability to do this?
What does the proposed API look like?
Just like the current one