问题描述
这是一个用 react CLI 创建的新项目。 我做了什么:
const cssRegex = /\.(css|less)$/;
const cssModuleRegex = /\.module\.(css|less)$/;
// "postcss" loader applies autoprefixer to our CSS.
// "css" loader resolves paths in CSS and adds assets as dependencies.
// "style" loader turns CSS into JS modules that inject <style> tags.
// In production,we use MiniCSSExtractPlugin to extract that CSS
// to a file,but in development "style" loader enables hot editing
// of CSS.
// By default we support CSS Modules with the extension .module.css
{
test: cssRegex,exclude: cssModuleRegex,use: getStyleLoaders({
importLoaders: 2,sourceMap: isEnvProduction
? shouldUseSourceMap
: isEnvDevelopment,modules: true,},'less-loader'),// Don't consider CSS imports dead code even if the
// containing package claims to have no side effects.
// Remove this when webpack adds a warning or an error for this.
// See https://github.com/webpack/webpack/issues/6571
sideEffects: true,
Failed to compile.
./src/index.css (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-4-1!./node_modules/postcss-loader/src??postcss!./node_modules/resolve-url-loader??ref--5-oneOf-4-3!./node_modules/less-loader/dist/cjs.js??ref--5-oneOf-4-4!./src/index.css)
TypeError: this.getoptions is not a function
我错过了什么吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)