手写笔语法 - 导入来自哪里? [英] Stylus syntax - where do imports come from?
问题描述
我有一个名为quasar.styl"的文件:
I've got a file called "quasar.styl":
@import './quasar.variables'
@import '~quasar-styl'
当它被 webpack 处理时,使用 styl-loader,我得到这个错误:
When it gets processed by webpack, using styl-loader, I get this error:
failed to locate @import file ~quasar-styl.styl
我有这种感觉,我不明白手写笔的某些方面.它会在哪里寻找文件~quasar-style"?
I have this feeling there's something about stylus I don't understand. Where would it be looking for the file "~quasar-style"?
这个文件来自一个工作样板类 quasar 应用程序,在应用程序目录的任何地方都没有一个名为 quasar-style
的文件,尤其是 node_modules,这是我收集波浪号告诉的地方看看.
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.
有什么想法吗?
更新:我在这里上传了类星体样板项目:https://repl.it/@jmbldwn/Quasar-Boilerplate-2
UPDATE: I uploaded the quasar boilerplate project here: https://repl.it/@jmbldwn/Quasar-Boilerplate-2
它不能在 repl.it 上运行,因为它需要 quasar-cli,但是你可以在那里看到它生成的所有文件.
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.
推荐答案
我刚刚解决了这个问题,这个问题发生在我在一个新的克隆中运行 $ npm install
时发生的,然后是 <代码>$ npm update,然后是$ vue upgrade
.
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
.
注意:我安装了Quasar的Vue CLI Quasar Plugin版本,我的quasar.js
配置文件以
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';
解决方案
在您的
src/styles/quasar.variables.styl
文件中,删除行@import '~quasar-variables-styl'
,它应该是接近底部.
In your
src/styles/quasar.variables.styl
file, remove the line@import '~quasar-variables-styl'
, which should be close to the bottom.
在您的 src/styles/quasar.styl
文件中,将 @import '~quasar-styl'
行替换为 @import '~quasar/dist/quasar.styl'
.
In your src/styles/quasar.styl
file, replace the line @import '~quasar-styl'
with @import '~quasar/dist/quasar.styl'
.
这篇关于手写笔语法 - 导入来自哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!