瀏覽代碼

feat: disable IIFE in bundle

Sven 1 年之前
父節點
當前提交
91ea128fcc
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      webpack.config.js

+ 5 - 0
webpack.config.js

@@ -13,6 +13,11 @@ export default {
     filename: "BetterYTM.user.js",
     path: join(dirname(fileURLToPath(import.meta.url)), "/dist"),
     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",
   resolve: {