import YAML files in a boot file with Vite? #16111
Unanswered
Dylan190774
asked this question in
General - Components / Directives / etc
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm wondering if it's possible to load a
YAML
file inside a boot-file withVite
. I like my default settings to be in YAML-format, instead of JSON.With
Webpack
I always usedyaml-import-loader
.I found https://github.com/Modyfi/vite-plugin-yaml , but I cannot get this to work in Quasar.
I added
[require('@modyfi/vite-plugin-yaml')],
to thebuild/vitePlugins
section inquasar.config.js
.It seems to work, but I get an error in runtime :
Failed to parse source for import analysis because the content contains invalid JS syntax. You may need to install appropriate plugins to handle the .yaml file format.
This happens when in my boot file I include:
import settings_yaml from './../assets/yaml/settings.yaml';
So something is not setup right yet.
I also added
"types": ["@modyfi/vite-plugin-yaml/modules"]
tocompilerOptions
intsconfig.json
(after doingyarn add @types/js-yaml --dev
), but this didn't help.Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions