build: use webpack dashboard

This commit is contained in:
EnixCoda 2024-07-15 10:42:05 +08:00
parent 126673b828
commit 897a116384
3 changed files with 756 additions and 12 deletions

View file

@ -11,7 +11,7 @@
"node": ">=18"
},
"scripts": {
"dev": "VERSION=dev-v$(node scripts/get-version.js) NODE_OPTIONS=--openssl-legacy-provider webpack --watch",
"dev": "VERSION=dev-v$(node scripts/get-version.js) NODE_OPTIONS=--openssl-legacy-provider webpack-dashboard -- webpack --watch",
"debug-firefox": "web-ext run --source-dir=dist-firefox --keep-profile-changes --start-url https://github.com/EnixCoda/Gitako",
"prepare": "husky install",
"postinstall": "patch-package",
@ -97,7 +97,8 @@
"web-ext": "^7.11.0",
"webpack": "^5.91.0",
"webpack-bundle-analyzer": "^4.10.2",
"webpack-cli": "^5.1.4"
"webpack-cli": "^5.1.4",
"webpack-dashboard": "^3.3.8"
},
"prettier": {
"printWidth": 100,

View file

@ -1,6 +1,7 @@
import * as path from 'node:path'
import * as s from 'superstruct'
import type { Configuration } from 'webpack'
const DashboardPlugin = require('webpack-dashboard/plugin')
const webpack = require('webpack')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin')
@ -18,6 +19,7 @@ function createConfig({ envTarget }: { envTarget: 'default' | 'firefox' | 'safar
}[envTarget]
const plugins = [
new DashboardPlugin(),
new CleanWebpackPlugin(),
new CopyWebpackPlugin({
patterns: [

761
yarn.lock

File diff suppressed because it is too large Load diff