From 7684cbd438ce337e03bd7cbdbc996e8c4410f347 Mon Sep 17 00:00:00 2001 From: Muffin Date: Wed, 15 May 2024 19:34:34 -0500 Subject: [PATCH] Use no-eval source maps instead eval is blocked by CSP in the addons settings page --- src-main/protocols.js | 1 + webpack.config.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src-main/protocols.js b/src-main/protocols.js index 2eaa881..f93d699 100644 --- a/src-main/protocols.js +++ b/src-main/protocols.js @@ -56,6 +56,7 @@ const FILE_SCHEMES = { const MIME_TYPES = new Map(); MIME_TYPES.set('.html', 'text/html'); MIME_TYPES.set('.js', 'text/javascript'); +MIME_TYPES.set('.map', 'application/json'); MIME_TYPES.set('.txt', 'text/plain'); MIME_TYPES.set('.json', 'application/json'); MIME_TYPES.set('.wav', 'audio/wav'); diff --git a/webpack.config.js b/webpack.config.js index f7feacb..9074230 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -4,7 +4,7 @@ const CopyWebpackPlugin = require('copy-webpack-plugin'); const base = { mode: process.env.NODE_ENV === 'production' ? 'production' : 'development', - devtool: process.env.NODE_ENV === 'production' ? false : 'eval', + devtool: process.env.NODE_ENV === 'production' ? false : 'cheap-source-map', target: 'web', module: { rules: [