2017-06-02 53 views
0

我不知道,但幾個月前,這工作得很好,但現在,它不再工作。與之反應的create-react-app模塊,更新webpack.config.dev.js來測試以下:創建反應應用程序和薩斯似乎並沒有工作

{ 
    test: /\.(css|scss)$/, 
    loader: 'style!css?importLoaders=1!postcss!sass' 
    }, 

...與依賴node-sasssass-loader,在.scss樣式不似乎越來越抓獲。

有什麼想法?

回答

0

我需要同時更新的WebPack配置中的url裝載機排除scss文件

exclude: [ 
     /\.html$/, 
     // We have to write /\.(js|jsx)(\?.*)?$/ rather than just /\.(js|jsx)$/ 
     // because you might change the hot reloading server from the custom one 
     // to Webpack's built-in webpack-dev-server/client?/, which would not 
     // get properly excluded by /\.(js|jsx)$/ because of the query string. 
     // Webpack 2 fixes this, but for now we include this hack. 
     // https://github.com/facebookincubator/create-react-app/issues/1713 
     /\.(js|jsx)(\?.*)?$/, 
     /\.(css|scss)$/, 
     /\.json$/, 
     /\.svg$/ 
    ], 
    loader: 'url', 
    query: { 
     limit: 10000, 
     name: 'static/media/[name].[hash:8].[ext]' 
    } 
    },