简体   繁体   English

无法使用Webpack覆盖加载.styl

[英]cant load .styl with webpack override

I am using react-app-rewired and want to use .styl as css. 我正在使用react-app- rewired并想使用.styl作为CSS。 The issue that I tried to add some plugin in order to use .styl inside my components with react. 我试图添加一些插件以便在我的组件内使用.styl进行反应的问题。

file name:config-overrides.js 文件名:config-overrides.js

var stylus_plugin = require('stylus_plugin');

    module.exports = function override(config, env) {
        config.plugins = [
            new stylusLoader.OptionsPlugin({
                default: {
                  use: [stylus_plugin()],
                },
              }),

the eror that I am getting 我得到的错误

Error: Cannot find module 'stylus_plugin'' 错误:找不到模块“ stylus_plugin”

find a great plugin that doing it 找到一个很棒的插件

npm install --save-dev react-app-rewire-stylus-modules npm install --save-dev react-app-rewire-stylus-modules

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM