diff options
author | Michael C <[email protected]> | 2022-05-24 21:14:36 -0400 |
---|---|---|
committer | Michael C <[email protected]> | 2022-05-24 21:14:36 -0400 |
commit | 2665327729e926b79a519fca42b132ac51aec10f (patch) | |
tree | bc52209f33acefa5615cb9ce34b5bc3eeca96469 /webpack | |
parent | 4738c1897f41c307b2a4643e214f2b95e1365add (diff) | |
download | SponsorBlock-2665327729e926b79a519fca42b132ac51aec10f.tar.gz SponsorBlock-2665327729e926b79a519fca42b132ac51aec10f.zip |
update dependencies & bump minimum node version (#1329)
- bump all dependences
- add github-actions reporter to jest
- convert (most) webpack configs to ESM
- manifest.cjs cannot be converted since there is no native .json import until node 17
Diffstat (limited to 'webpack')
-rw-r--r-- | webpack/webpack.common.js | 21 | ||||
-rw-r--r-- | webpack/webpack.dev.js | 7 | ||||
-rw-r--r-- | webpack/webpack.manifest.cjs (renamed from webpack/webpack.manifest.js) | 0 | ||||
-rw-r--r-- | webpack/webpack.prod.js | 7 |
4 files changed, 18 insertions, 17 deletions
diff --git a/webpack/webpack.common.js b/webpack/webpack.common.js index a3541ab3..4f751af2 100644 --- a/webpack/webpack.common.js +++ b/webpack/webpack.common.js @@ -1,12 +1,15 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ // eslint-disable-next-line @typescript-eslint/no-unused-vars -const webpack = require("webpack"); -const path = require('path'); -const CopyPlugin = require('copy-webpack-plugin'); -const BuildManifest = require('./webpack.manifest'); -const srcDir = '../src/'; -const fs = require("fs"); -const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); +import webpack from "webpack" +import path from "path" +import { fileURLToPath } from "url" +import CopyPlugin from "copy-webpack-plugin" +import BuildManifest from "./webpack.manifest.cjs"; +const srcDir = "../src/"; +import fs from "fs"; +import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"; + +const __filename = fileURLToPath(import.meta.url) +const __dirname = path.dirname(__filename) const edgeLanguages = [ "de", @@ -24,7 +27,7 @@ const edgeLanguages = [ "zh_CN" ] -module.exports = env => ({ +export default env => ({ entry: { popup: path.join(__dirname, srcDir + 'popup.ts'), background: path.join(__dirname, srcDir + 'background.ts'), diff --git a/webpack/webpack.dev.js b/webpack/webpack.dev.js index c1b9472c..9e2eefe5 100644 --- a/webpack/webpack.dev.js +++ b/webpack/webpack.dev.js @@ -1,8 +1,7 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ -const merge = require('webpack-merge'); -const common = require('./webpack.common.js'); +import { merge } from "webpack-merge"; +import common from './webpack.common.js'; -module.exports = env => merge(common(env), { +export default env => merge(common(env), { devtool: 'inline-source-map', mode: 'development' });
\ No newline at end of file diff --git a/webpack/webpack.manifest.js b/webpack/webpack.manifest.cjs index 3e30ffc6..3e30ffc6 100644 --- a/webpack/webpack.manifest.js +++ b/webpack/webpack.manifest.cjs diff --git a/webpack/webpack.prod.js b/webpack/webpack.prod.js index fe935af8..08edbb78 100644 --- a/webpack/webpack.prod.js +++ b/webpack/webpack.prod.js @@ -1,8 +1,7 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ -const merge = require('webpack-merge'); -const common = require('./webpack.common.js'); +import { merge } from "webpack-merge"; +import common from './webpack.common.js'; -module.exports = env => { +export default env => { let mode = "production"; env.mode = mode; |