Rollup 插件 postcss 不会注入从 node_modules

这是我的汇总配置

// rollup.config.js
const postcss = require('rollup-plugin-postcss');
const autoprefixer = require('autoprefixer');

module.exports = {
  rollup(config,_options) {
    config.plugins.push(
      postcss({
        plugins: [
          autoprefixer(),],extensions: ['.css'],modules: false,extract: false,}),);
    return config;
  },};

因此,如果我从相对路径导入本地 css 文件,它会被注入,但我从 node_modules 导入它不会

import React from 'react';
import { toast } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
// The following works if I copy the file locally
// import './ReactToastify.css';

我在这里做错了什么?

daiqilin1970 回答:Rollup 插件 postcss 不会注入从 node_modules

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/16254.html

大家都在问