From 225a5d16b06acaa060714c5082e968a8e21112b5 Mon Sep 17 00:00:00 2001 From: Quan HL Date: Tue, 7 May 2024 13:29:47 +0700 Subject: [PATCH] wip --- package.json | 2 +- public/ext_manifest.json | 23 ------- public/manifest.json | 27 +++++++-- webpack.config.js | 125 +++++++++++---------------------------- 4 files changed, 56 insertions(+), 121 deletions(-) delete mode 100644 public/ext_manifest.json diff --git a/package.json b/package.json index e58f570..9b74ee7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webrtc-chrome-ext", - "version": "1.0.5", + "version": "1.0.6", "private": true, "dependencies": { "@chakra-ui/react": "^2.8.0", diff --git a/public/ext_manifest.json b/public/ext_manifest.json deleted file mode 100644 index 54e2fc3..0000000 --- a/public/ext_manifest.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "version": "1.0.5", - "manifest_version": 3, - "name": "jambonz webrtc phone", - "description": "jambonz webrtc phone", - "action": { - "default_title": "jambonz webrtc phone" - }, - "background": { - "service_worker": "background/index.js" - }, - "permissions": ["storage"], - "host_permissions": ["https://*/*"], - "icons": { - "16": "icons/icon.png", - "48": "icons/icon.png", - "128": "icons/icon.png", - "192": "icons/icon192.png", - "384": "icons/icon384.png", - "512": "icons/icon512.png", - "1024": "icons/icon1024.png" - } -} diff --git a/public/manifest.json b/public/manifest.json index cbb2e04..fda24ce 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -1,8 +1,23 @@ { - "short_name": "Jambonz WebPhone", - "name": "Jambonz WebPhone", - "start_url": ".", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" + "version": "1.0.6", + "manifest_version": 3, + "name": "jambonz webrtc phone", + "description": "jambonz webrtc phone", + "action": { + "default_title": "jambonz webrtc phone" + }, + "background": { + "service_worker": "background/index.js" + }, + "permissions": ["storage"], + "host_permissions": ["https://*/*"], + "icons": { + "16": "icons/icon.png", + "48": "icons/icon.png", + "128": "icons/icon.png", + "192": "icons/icon192.png", + "384": "icons/icon384.png", + "512": "icons/icon512.png", + "1024": "icons/icon1024.png" + } } diff --git a/webpack.config.js b/webpack.config.js index 3069014..95e7355 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -3,34 +3,34 @@ const HTMLPlugin = require("html-webpack-plugin"); const CopyPlugin = require("copy-webpack-plugin"); module.exports = [ - { - entry: "./src/content/index.tsx", - target: "web", - mode: "production", - output: { - path: path.join(__dirname, "dist"), - filename: "js/content.js", - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: [ - { - loader: "ts-loader", - options: { - compilerOptions: { noEmit: false }, - }, - }, - ], - exclude: /node_modules/, - }, - ], - }, - resolve: { - extensions: [".ts", ".tsx", ".js"], - }, - }, + // { + // entry: "./src/content/index.tsx", + // target: "web", + // mode: "production", + // output: { + // path: path.join(__dirname, "dist"), + // filename: "js/content.js", + // }, + // module: { + // rules: [ + // { + // test: /\.tsx?$/, + // use: [ + // { + // loader: "ts-loader", + // options: { + // compilerOptions: { noEmit: false }, + // }, + // }, + // ], + // exclude: /node_modules/, + // }, + // ], + // }, + // resolve: { + // extensions: [".ts", ".tsx", ".js"], + // }, + // }, { entry: "./src/background/index.ts", target: "web", @@ -59,68 +59,6 @@ module.exports = [ extensions: [".ts", ".tsx", ".js"], }, }, - { - entry: { - index: "./src/index.tsx", - }, - mode: "production", - module: { - rules: [ - { - test: /\.tsx?$/, - use: [ - { - loader: "ts-loader", - options: { - compilerOptions: { noEmit: false }, - }, - }, - ], - exclude: /node_modules/, - }, - { - exclude: /node_modules/, - test: /\.css$/i, - use: ["style-loader", "css-loader"], - }, - { - test: /\.s[ac]ss$/i, - use: [ - // Creates `style` nodes from JS strings - "style-loader", - // Translates CSS into CommonJS - "css-loader", - // Compiles Sass to CSS - "sass-loader", - ], - }, - { - test: /\.txt$/i, - type: "asset/source", - }, - ], - }, - plugins: [ - new CopyPlugin({ - patterns: [{ from: "public", to: ".." }], - }), - ...getHtmlPlugins(["index"]), - ], - resolve: { - alias: { - src: path.resolve(__dirname, "src/"), - }, - extensions: [".tsx", ".ts", ".js", ".txt"], - }, - output: { - path: path.join(__dirname, "dist/js"), - filename: "[name].js", - }, - performance: { - maxEntrypointSize: 512000, - maxAssetSize: 512000, - }, - }, { entry: { index: "./src/window/index.tsx", @@ -162,7 +100,12 @@ module.exports = [ }, ], }, - plugins: [...getHtmlPlugins(["index"])], + plugins: [ + new CopyPlugin({ + patterns: [{ from: "public", to: ".." }], + }), + ...getHtmlPlugins(["index"]), + ], resolve: { alias: { src: path.resolve(__dirname, "src/"),