搜索

首页  >  问答  >  正文

javascript - 奇怪。 require('stylus') in .vue file 失败

我想在.vue文件的<script>中是用stylus

let stylus = require('stylus')
console.log(stylus)

但是失败了。

This dependency was not found:
* fs in ./~/.0.54.5@stylus/lib/utils.js, ./~/.0.54.5@stylus/lib/middleware.js and 12 others
To install it, you can run: npm install --save fs
This relative module was not found:
* ./lib-cov/stylus in ./~/.0.54.5@stylus/index.js

我新建了个test.js文件,在里面引用却没问题。

我试过在webpack.base.conf.js 中设置这个:

{
            test: /\.styl$/,
            loader: 'style-loader!css-loader!stylus-loader'
        }
        

没用。

有人有踩过这个坑或者任何想法吗?

感谢

大家讲道理大家讲道理2812 天前714

全部回复(1)我来回复

  • 淡淡烟草味

    淡淡烟草味2017-06-12 09:25:07

    stylus 无法运行在浏览器上,不能引用。

    回复
    0
  • 取消回复