javascript - Weird. require('stylus') in .vue file fails
大家讲道理
大家讲道理 2017-06-12 09:23:07
0
1
705

I want to use stylus

in the <script> of the .vue file
let stylus = require('stylus')
console.log(stylus)

but failed.

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

I created a new test.js file and there is no problem in quoting it in it.

I tried setting this in webpack.base.conf.js:

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

Useless.

Has anyone experienced this pitfall or have any ideas?

grateful

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(1)
淡淡烟草味

stylus cannot run on the browser and cannot be referenced.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template