问题
I've got a file called "quasar.styl":
@import './quasar.variables'
@import '~quasar-styl'
When it gets processed by webpack, using styl-loader, I get this error:
failed to locate @import file ~quasar-styl.styl
I have this feeling there's something about stylus I don't understand. Where would it be looking for the file "~quasar-style"?
This file comes from a working boilerplate quasar app, and there isn't a file called quasar-style
anywhere in the app directories, especially not is node_modules, which is where I gather the tilde tells it to look.
Any ideas?
UPDATE: I uploaded the quasar boilerplate project here: https://repl.it/@jmbldwn/Quasar-Boilerplate-2
It's not runnable on repl.it because it needs the quasar-cli, but you can see all of the files generated by it there.
回答1:
I just got a fix to this problem, which happened to me when running $ npm install
in a new clone, followed by $ npm update
, followed by $ vue upgrade
.
Note: I had installed the Vue CLI Quasar Plugin version of Quasar, and my quasar.js
configuration file begins with
import Vue from 'vue';
import '@/styles/quasar.styl';
Solution
In your
src/styles/quasar.variables.styl
file, remove the line@import '~quasar-variables-styl'
, which should be close to the bottom.In your
src/styles/quasar.styl
file, replace the line@import '~quasar-styl'
with@import '~quasar/dist/quasar.styl'
.
来源:https://stackoverflow.com/questions/58151768/stylus-syntax-where-do-imports-come-from