简体   繁体   English

为什么我的 scss 不能在 MacOS 上处理 React 项目

[英]why my scss doesn't working on react project on MacOS

I have successfully installed node-sass for my project but any change on "scss" file is not compiled.我已成功为我的项目安装了 node-sass ,但未编译“scss”文件上的任何更改。

An example: If i change a color on "scss" in browser i see just a color that was before on "scss" file before i have cloned the project.一个例子:如果我在浏览器中更改“scss”上的颜色,我只会看到克隆项目之前“scss”文件上的颜色。

Note: I did it on old windows laptop and everything works fine but on mac doesn't.注意:我在旧的 Windows 笔记本电脑上做的,一切正常,但在 mac 上没有。

I have tried to rebuild node-sass and reinstal node js but it deosn'work at all.我试图重建 node-sass 并重新安装 node js,但它根本不起作用。

You app i think is not watching the sass files check the webpack.config.js file and add this property to module property我认为您的应用程序没有查看 sass 文件,请检查webpack.config.js文件并将此属性添加到module属性中

{
    test: /\.s?css$/,
    use: CSSExtract.extract({
      use: [
        {
          loader: 'css-loader',
          options: {
            sourceMap: true
          }
        },
        {
          loader: 'sass-loader',
          options: {
            sourceMap: true
          }
        }
      ]
    })
  }

see if this helps看看这是否有帮助

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

相关问题 为什么我的 Scss mixin 在我的 React 项目中不起作用? - Why doesnt my Scss mixin work in my React Project? 为什么引导手风琴组件在我的反应项目中不起作用? - Why bootstrap accordion component doesn't work in my react project? 为什么我的“Swiper”组件在 typescript 反应项目中不起作用? - Why my "Swiper" component doesn't work in a typescript react project? Babel为什么不从事我的React Native项目? - Why isn't Babel working on my React Native project? 为什么 onClick 不能处理我的反应项目 - why onClick isn't working on my react project 为什么我的 onClick 在我的 React 项目中不起作用 - Why is my onClick not working in my React Project 为什么我的 SCSS 无法加载,即使它位于我使用 React.js 搭建的 Laravel 项目中的 webpack.mix.js 中? - Why won't my SCSS load even though it's in the webpack.mix.js in my Laravel project that's scaffolded with React.js? 为什么我在 React 中的 clearInterval 不起作用? - Why my clearInterval in React doesn't work? Scss mixin 边框 animation 在样式组件中的工作方式不同,在反应中,为什么? - Scss mixin border animation doesn't work in the same way in styled component, in react, why? 为什么在我的TypeScript项目中没有react-tap-event-plugin? - Why isn't react-tap-event-plugin working in my TypeScript project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM