带有postcss的手写笔加载器

时间:2020-03-15 03:10:41

标签: webpack postcss-loader stylus-loader

因此,有一个Vue应用程序,想使用Stylus,但是我也将PostCSS与postcssPresetEnv插件一起使用,并且我很难让两者合作。我开始使用posttylus,就像这样

const postcssPresetEnv = require('postcss-preset-env');

module: {
    rules : [
        ...,
        {
            test: /\.styl(us)?$/,
            use: ['vue-style-loader', 'css-loader', 'stylus-loader']
        },
    ]
},
plugins: [
    new webpack.LoaderOptionsPlugin({
        options: {
            stylus: {
                use: [poststylus(postcssPresetEnv())]
            }
        }
    }),
]

但是,这将不起作用,因为显然postcssPresetEnv是异步的,并且posttylus无法进行异步。那么,还有其他方法可以通过某种方式将手写笔通过管道传递到postCSS吗?我看到this看起来很有希望,但我不确定它在做什么。

0 个答案:

没有答案
相关问题