Ver código fonte

feat: disable IIFE in bundle

Sven 1 ano atrás
pai
commit
91ea128fcc
1 arquivos alterados com 5 adições e 0 exclusões
  1. 5 0
      webpack.config.js

+ 5 - 0
webpack.config.js

@@ -13,6 +13,11 @@ export default {
     filename: "BetterYTM.user.js",
     filename: "BetterYTM.user.js",
     path: join(dirname(fileURLToPath(import.meta.url)), "/dist"),
     path: join(dirname(fileURLToPath(import.meta.url)), "/dist"),
     clean: true,
     clean: true,
+    module: true,
+  },
+  experiments: {
+    // userscripts are automatically wrapped in an IIFE by the browser extension, so this can be enabled
+    outputModule: true,
   },
   },
   mode: minify ? "production" : "development",
   mode: minify ? "production" : "development",
   resolve: {
   resolve: {