Stylus syntax - where do imports come from?

旧城冷巷雨未停 提交于 2021-01-28 07:10:17

问题


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

  1. In your src/styles/quasar.variables.styl file, remove the line @import '~quasar-variables-styl', which should be close to the bottom.

  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!