new firefox in webpack

This commit is contained in:
Matteo Manzinello
2020-07-25 15:40:52 +02:00
parent 6f015f2481
commit 9fed283cae
5 changed files with 11 additions and 11 deletions
-2
View File
File diff suppressed because one or more lines are too long
-1
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -37,7 +37,7 @@ module.exports = [
mode: "production",
target: "web",
devtool: "source-map",
entry: "./mailgo.direct.ts",
entry: "./mailgo.firefox.ts",
context: path.join(__dirname, "webpack"),
module: {
rules: mailgoRules,
@@ -46,7 +46,7 @@ module.exports = [
extensions: [".ts", ".js"],
},
output: {
filename: "mailgo.direct.min.js",
filename: "mailgo.firefox.min.js",
library: "mailgo",
libraryTarget: "window",
path: path.resolve(__dirname, "dist"),
-6
View File
@@ -1,6 +0,0 @@
// webpack > dist/mailgo.direct.js
// useful for some addons like Firefox
import mailgo from "../src/mailgo";
mailgo();
+9
View File
@@ -0,0 +1,9 @@
// webpack > dist/mailgo.firefox.js
// script to add in Firefox addon
import mailgo from "../src/mailgo";
// check if mailgo HTML is already present in the page
let mailgoExists = !!document.getElementById("mailgo");
if (!mailgoExists) mailgo();