相关疑难解决方法(0)

webpack + babel loader源地图引用空文件

我有一个es6项目,我使用webpack + babel loader捆绑.当我打开devtools时,我可以看到'webpack://'和我下面的所有源(es6).

问题是:断点没有命中,函数引用将我引导到文件名'?d41d

其中包含以下内容:

undefined


/** WEBPACK FOOTER **
 ** 
 **/
Run Code Online (Sandbox Code Playgroud)

如果我从文档脚本向下钻取到我的包中的函数,我也可以访问?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']
                }
            }
        ]
    }
};
Run Code Online (Sandbox Code Playgroud)

和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", …
Run Code Online (Sandbox Code Playgroud)

source-maps webpack babeljs

13
推荐指数
2
解决办法
2223
查看次数

标签 统计

babeljs ×1

source-maps ×1

webpack ×1