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
Vue.js 正在激活vue cli 3中“vue样式加载器”的源映射_Vue.js_Webpack_Vuejs2 - Fatal编程技术网

Vue.js 正在激活vue cli 3中“vue样式加载器”的源映射

Vue.js 正在激活vue cli 3中“vue样式加载器”的源映射,vue.js,webpack,vuejs2,Vue.js,Webpack,Vuejs2,我正在尝试为我的cli3项目中的所有内容激活sourcemaps 到目前为止我有 vue.config.js 根据这一点,没有更多的选择,除了我不使用的更少 现在vue inspect给了我: { loader: 'vue-style-loader', options: { sourceMap: false, shadowMode: false }

我正在尝试为我的cli3项目中的所有内容激活sourcemaps

到目前为止我有

vue.config.js

根据这一点,没有更多的选择,除了我不使用的更少

现在vue inspect给了我:

          {
            loader: 'vue-style-loader',
            options: {
              sourceMap: false,
              shadowMode: false
            }
          },
          {
            loader: 'css-loader',
            options: {
              sourceMap: true,
              importLoaders: 2
            }
          },
          {
            loader: 'postcss-loader',
            options: {
              sourceMap: true
            }
          },
          {
            loader: 'sass-loader',
            options: {
              sourceMap: true,
              implementation: {
                run_: function() {
                          return _call(f, Array.prototype.slice.apply(arguments));
                        },
                render: function() {
                          return _call(f, Array.prototype.slice.apply(arguments));
                        },
                renderSync: function() {
                          return _call(f, Array.prototype.slice.apply(arguments));
                        },
                info: 'dart-sass\t1.22.9\t(Sass Compiler)\t[Dart]\ndart2js\t2.4.0\t(Dart Compiler)\t[Dart]',
                types: {
                  Boolean: function() {
                            return _call(f, Array.prototype.slice.apply(arguments));
                          },
                  Color: function() {
                            return _call(f, this, Array.prototype.slice.apply(arguments));
                          },
                  List: function() {
                            return _call(f, this, Array.prototype.slice.apply(arguments));
                          },
                  Map: function() {
                            return _call(f, this, Array.prototype.slice.apply(arguments));
                          },
                  Null: function() {
                            return _call(f, Array.prototype.slice.apply(arguments));
                          },
                  Number: function() {
                            return _call(f, this, Array.prototype.slice.apply(arguments));
                          },
                  String: function() {
                            return _call(f, this, Array.prototype.slice.apply(arguments));
                          },
                  Error: function Error() { [native code] }
                }
              },
              indentedSyntax: true
            }
如何激活vue组件样式的sourcemaps?此外,configurewebpack.devtool似乎根本没有效果。或者,它是否仅在与LoaderOption配对时才起作用

谢谢:

应该是:

module.exports={ css:{sourceMap:true}, 要解决vue css sourcemaps的所有问题,请参阅

          {
            loader: 'vue-style-loader',
            options: {
              sourceMap: false,
              shadowMode: false
            }
          },
          {
            loader: 'css-loader',
            options: {
              sourceMap: true,
              importLoaders: 2
            }
          },
          {
            loader: 'postcss-loader',
            options: {
              sourceMap: true
            }
          },
          {
            loader: 'sass-loader',
            options: {
              sourceMap: true,
              implementation: {
                run_: function() {
                          return _call(f, Array.prototype.slice.apply(arguments));
                        },
                render: function() {
                          return _call(f, Array.prototype.slice.apply(arguments));
                        },
                renderSync: function() {
                          return _call(f, Array.prototype.slice.apply(arguments));
                        },
                info: 'dart-sass\t1.22.9\t(Sass Compiler)\t[Dart]\ndart2js\t2.4.0\t(Dart Compiler)\t[Dart]',
                types: {
                  Boolean: function() {
                            return _call(f, Array.prototype.slice.apply(arguments));
                          },
                  Color: function() {
                            return _call(f, this, Array.prototype.slice.apply(arguments));
                          },
                  List: function() {
                            return _call(f, this, Array.prototype.slice.apply(arguments));
                          },
                  Map: function() {
                            return _call(f, this, Array.prototype.slice.apply(arguments));
                          },
                  Null: function() {
                            return _call(f, Array.prototype.slice.apply(arguments));
                          },
                  Number: function() {
                            return _call(f, this, Array.prototype.slice.apply(arguments));
                          },
                  String: function() {
                            return _call(f, this, Array.prototype.slice.apply(arguments));
                          },
                  Error: function Error() { [native code] }
                }
              },
              indentedSyntax: true
            }