This commit is contained in:
Nathan Bierema 2022-11-06 17:58:43 -05:00
parent 33104f5480
commit b3a9889a71
7 changed files with 7 additions and 14 deletions

View File

@ -22,7 +22,7 @@
"test:app": "cross-env BABEL_ENV=test jest test/app", "test:app": "cross-env BABEL_ENV=test jest test/app",
"test:chrome": "jest test/chrome", "test:chrome": "jest test/chrome",
"test:electron": "pnpm run build:test:electron:fixture && jest test/electron", "test:electron": "pnpm run build:test:electron:fixture && jest test/electron",
"test": "pnpm run test:app && pnpm run build:extension && pnpm run build:chrome && pnpm run test:chrome && pnpm run test:electron", "test": "pnpm run test:app && pnpm run build:extension && pnpm run test:chrome && pnpm run test:electron",
"build:test:electron:fixture": "webpack --config test/electron/fixture/webpack.config.js", "build:test:electron:fixture": "webpack --config test/electron/fixture/webpack.config.js",
"type-check": "tsc --noEmit" "type-check": "tsc --noEmit"
}, },

View File

@ -4,8 +4,8 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
module.exports = function (env) { module.exports = function (env) {
return { return {
// devtool: 'source-map',
mode: env.production ? 'production' : 'development', mode: env.production ? 'production' : 'development',
devtool: env.production ? 'source-map' : 'eval-source-map',
entry: { entry: {
background: [ background: [
path.resolve(__dirname, 'src/chromeApiMock'), path.resolve(__dirname, 'src/chromeApiMock'),
@ -27,10 +27,12 @@ module.exports = function (env) {
path.resolve(__dirname, 'src/contentScript/index'), path.resolve(__dirname, 'src/contentScript/index'),
], ],
page: path.join(__dirname, 'src/pageScript'), page: path.join(__dirname, 'src/pageScript'),
...(env.production
? {}
: { pagewrap: path.resolve(__dirname, 'src/pageScriptWrap') }),
}, },
output: { output: {
filename: '[name].bundle.js', filename: '[name].bundle.js',
chunkFilename: '[id].chunk.js',
}, },
plugins: [ plugins: [
new ForkTsCheckerWebpackPlugin({ new ForkTsCheckerWebpackPlugin({
@ -45,7 +47,7 @@ module.exports = function (env) {
to: path.join(__dirname, 'dist/manifest.json'), to: path.join(__dirname, 'dist/manifest.json'),
}, },
{ {
from: path.join(__dirname, 'src/assets/'), from: path.join(__dirname, 'src/assets'),
to: path.join(__dirname, 'dist'), to: path.join(__dirname, 'dist'),
}, },
], ],

View File

@ -3,12 +3,12 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
module.exports = { module.exports = {
mode: 'production', mode: 'production',
devtool: 'source-map',
entry: { entry: {
pagewrap: path.resolve(__dirname, 'src/pageScriptWrap'), pagewrap: path.resolve(__dirname, 'src/pageScriptWrap'),
}, },
output: { output: {
filename: '[name].bundle.js', filename: '[name].bundle.js',
chunkFilename: '[id].chunk.js',
}, },
plugins: [ plugins: [
new ForkTsCheckerWebpackPlugin({ new ForkTsCheckerWebpackPlugin({

View File

@ -103,7 +103,6 @@
"html-webpack-plugin": "^5.5.0", "html-webpack-plugin": "^5.5.0",
"jest": "^29.2.2", "jest": "^29.2.2",
"jest-environment-jsdom": "^29.2.2", "jest-environment-jsdom": "^29.2.2",
"path-browserify": "^1.0.1",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",

View File

@ -39,9 +39,6 @@ export default (
}, },
resolve: { resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'], extensions: ['.js', '.jsx', '.ts', '.tsx'],
fallback: {
path: require.resolve('path-browserify'),
},
}, },
plugins: [ plugins: [
new webpack.DefinePlugin({ new webpack.DefinePlugin({

View File

@ -39,9 +39,6 @@ export default (env: { production?: boolean } = {}): webpack.Configuration => ({
}, },
resolve: { resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'], extensions: ['.js', '.jsx', '.ts', '.tsx'],
fallback: {
path: require.resolve('path-browserify'),
},
}, },
plugins: [ plugins: [
new webpack.DefinePlugin({ new webpack.DefinePlugin({

View File

@ -838,7 +838,6 @@ importers:
jsondiffpatch: ^0.4.1 jsondiffpatch: ^0.4.1
localforage: ^1.10.0 localforage: ^1.10.0
lodash: ^4.17.21 lodash: ^4.17.21
path-browserify: ^1.0.1
prop-types: ^15.8.1 prop-types: ^15.8.1
react: ^18.2.0 react: ^18.2.0
react-dom: ^18.2.0 react-dom: ^18.2.0
@ -920,7 +919,6 @@ importers:
html-webpack-plugin: 5.5.0_webpack@5.74.0 html-webpack-plugin: 5.5.0_webpack@5.74.0
jest: 29.2.2_4pb6an67rakrle6rtido6z2a34 jest: 29.2.2_4pb6an67rakrle6rtido6z2a34
jest-environment-jsdom: 29.2.2 jest-environment-jsdom: 29.2.2
path-browserify: 1.0.1
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0_react@18.2.0 react-dom: 18.2.0_react@18.2.0
rimraf: 3.0.2 rimraf: 3.0.2