Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Webpack 创建react应用程序和Sass don';他似乎不在工作_Webpack_Sass_Create React App - Fatal编程技术网

Webpack 创建react应用程序和Sass don';他似乎不在工作

Webpack 创建react应用程序和Sass don';他似乎不在工作,webpack,sass,create-react-app,Webpack,Sass,Create React App,我不确定,但几个月前,这种方法效果很好,但现在,它似乎不再起作用了。使用React的create React app模块,更新webpack.config.dev.js以测试以下各项: { test: /\.(css|scss)$/, loader: 'style!css?importLoaders=1!postcss!sass' }, 。。。使用依赖项节点sass和sass加载程序,似乎不会捕获.scss样式 有什么想法吗?我还需要更新网页配置中的url加载程序,以排

我不确定,但几个月前,这种方法效果很好,但现在,它似乎不再起作用了。使用React的
create React app
模块,更新
webpack.config.dev.js
以测试以下各项:

  {
    test: /\.(css|scss)$/,
    loader: 'style!css?importLoaders=1!postcss!sass'
  },
。。。使用依赖项
节点sass
sass加载程序
,似乎不会捕获
.scss
样式


有什么想法吗?

我还需要更新网页配置中的
url
加载程序,以排除
scs
文件

    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]'
    }
  },