webpack + babel loader 源映射引用空文件

2023-11-25

我有一个 es6 项目,我使用 webpack + babel loader 捆绑它。 当我打开开发工具时,我可以在下面看到“webpack://”和我的所有源代码(es6)。

问题是:断点没有命中,函数引用将我定向到文件名“?d41d”

其中有以下内容:

undefined


/** WEBPACK FOOTER **
 ** 
 **/

如果我从文档脚本深入到包中的函数,我也会得到 ?d41d 文件

我的 webpack.config.js:

module.exports = {

    debug: true,
    devtool: 'cheap-module-eval-source-map',
    entry: "entry.js",
    output: {
        path: "C:/html5/",
        filename: "bundle.js"
    },
    module: {
        loaders: [
            {
                test: /\.js$/,
                exclude: /(node_modules|bower_components)/,
                loader: 'babel',
                query: {
                    presets: ['es2015'],
                    plugins: ['transform-object-assign'],
                    sourceMaps: ['inline']
                }
            }
        ]
    }
};

以及 package.json 的一部分,以防它可能有帮助:

"devDependencies": {
    "ava": "^0.16.0",
    "babel-core": "^6.14.0",
    "babel-loader": "^6.2.5",
    "babel-plugin-transform-object-assign": "^6.8.0",
    "babel-preset-es2015": "^6.13.2",
    "cheerio": "^0.22.0",
    "chokidar-cli": "^1.2.0",
    "eslint": "^3.3.1",
    "html-to-js": "0.0.1",
    "jsdoc": "^3.4.0",
    "jsdom": "^9.4.2",
    "minami": "^1.1.1",
    "obfuscator": "^0.5.4",
    "sinon": "^1.17.5",
    "uglify-js": "^2.7.3",
    "webpack": "^1.13.2",
    "yargs": "^5.0.0"
  },
  "dependencies": {
    "jquery": "^3.1.0"
  }

提前致谢。


这也是今天才开始发生在我身上的,

我不确定问题的根源是什么,但是切换devtool from cheap-module-eval-source-map to sourceMap暂时解决了这个问题。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

webpack + babel loader 源映射引用空文件 的相关文章

随机推荐