【问题标题】:Cannot read property 'compilation' of undefined无法读取未定义的属性“编译”
【发布时间】:2019-02-01 10:20:34
【问题描述】:

在将 sass-lint-webpackCreate React App 连接到 webpack.config.dev.js 后,我遇到了未捕获的错误

只需将其添加到 webpack.config.dev.js

const SassLintPlugin = require('sass-lint-webpack')

new SassLintPlugin()

然后在运行yarn start 之后 - 我收到错误:“无法读取未定义的属性‘编译’”

有什么解决办法吗?

【问题讨论】:

    标签: webpack sass-lint


    【解决方案1】:

    所以你需要在使用 npm 安装时指定版本的插件:

    npm install --save-dev uglifyjs-webpack-plugin@1
    

    【讨论】:

      【解决方案2】:

      插件已过时,请改用https://github.com/swordray/sass-lint-webpack,它已与新的 webpack 基础设施保持同步。

      【讨论】:

      • 感谢您的关注,我写错了问题,指出了错误的 githab 插件。我指出 sasslint-webpack-plugin 而不是实际使用 sass-lint-webpack 截图:s.mail.ru/DAxs/o8yn9wEyr
      • 不管怎样,我发现了一个新插件:stylelint-webpack-plugin,我现在尝试安装它
      • 现在我明白为什么有人给我减分了——因为我的错误,我在我的问题中指出了废弃的插件
      猜你喜欢
      • 2021-04-23
      • 2017-12-30
      • 2023-01-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-12
      • 1970-01-01
      相关资源
      最近更新 更多