Chrome Extension: Not loading source-maps

前端 未结 1 2080
北荒
北荒 2021-02-08 13:55

I am not able to load sourcemap in Chrome Extension for some reason.

The folder which is being loaded for Chrome Extension has .map just next to .js<

1条回答
  •  甜味超标
    2021-02-08 14:08

    Setting the following property in webpack.config.js worked for me:

    module.exports = {
        //Configuration parameters
    
        devtool: 'eval-source-map',
    
        //Other configuration parameters
    }
    

    Edit: You'll also have to update manifest.json to allow eval:

    "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'"
    

    List of devTool styles: https://webpack.js.org/configuration/devtool/#devtool

    webpack.config.js explained: https://webpack.js.org/configuration/

    0 讨论(0)
提交回复
热议问题