Mattermost, Inc.

Non minified plugin development

Hi!

I am working on a plugin for Mattermost, and would like to be able to debug it in Chrome. However, the file is minified, and very unreadable.

I tried to set webpack to development mode, and it still isn’t readable and gives me the message: "Uncaught EvalError: Refused to evaluate a string as JavaScript because ‘unsafe-eval’ is not an allowed source of script in the following Content Security Policy directive: "script-src ‘self’ cdn.segment.com/analytics.js/"."

Setting webpack to none mode seems to make it readable enough, so that pretty well solves my issue. For any future googlers, change "build": "webpack --mode=production", to "build": "webpack --mode=none", in package.json.

3 Likes

Thanks for this feedback, @lsenseney3! I’ve created a help-wanted ticket to make this easy for anyone building off the mattermost-plugin-starter-template: https://github.com/mattermost/mattermost-server/issues/11945.