chore: add @types/webpack-sources dev dep

Signed-off-by: JounQin <admin@1stg.me>
This commit is contained in:
JounQin
2024-08-09 11:35:09 +08:00
parent b676cc944f
commit 28a0779d6e
3 changed files with 28 additions and 1 deletions
+1
View File
@@ -184,6 +184,7 @@
"@types/svgo": "^2.6.2",
"@types/tar": "^6.1.1",
"@types/terser-webpack-plugin": "^5.0.4",
"@types/webpack-sources": "^3.2.3",
"@types/yarnpkg__lockfile": "^1.1.4",
"@vitejs/plugin-react": "^4.0.4",
"del": "^7.0.0",
+8 -1
View File
@@ -20,17 +20,24 @@ import { resolveBundlingPaths } from './paths';
import { BackendServeOptions } from './types';
export async function serveBackend(options: BackendServeOptions) {
const useRspack = !!process.env.EXPERIMENTAL_RSPACK;
const paths = resolveBundlingPaths(options);
const config = await createBackendConfig(paths, {
...options,
isDev: true,
useRspack,
});
// Webpack only replaces occurrences of this in code it touches, which does
// not include dependencies in node_modules. So we set it here at runtime as well.
(process.env as { NODE_ENV: string }).NODE_ENV = 'development';
const compiler = webpack(config, (err: Error | null) => {
const bundler: typeof webpack = useRspack
? require('@rspack/core').rspack
: webpack;
const compiler = bundler(config, (err: Error | null) => {
if (err) {
console.error(err);
} else console.log('Build succeeded');
+19
View File
@@ -3990,6 +3990,7 @@ __metadata:
"@types/tar": ^6.1.1
"@types/terser-webpack-plugin": ^5.0.4
"@types/webpack-env": ^1.15.2
"@types/webpack-sources": ^3.2.3
"@types/yarnpkg__lockfile": ^1.1.4
"@typescript-eslint/eslint-plugin": ^6.12.0
"@typescript-eslint/parser": ^6.7.2
@@ -19223,6 +19224,13 @@ __metadata:
languageName: node
linkType: hard
"@types/source-list-map@npm:*":
version: 0.1.6
resolution: "@types/source-list-map@npm:0.1.6"
checksum: 9cd294c121f1562062de5d241fe4d10780b1131b01c57434845fe50968e9dcf67ede444591c2b1ad6d3f9b6bc646ac02cc8f51a3577c795f9c64cf4573dcc6b1
languageName: node
linkType: hard
"@types/ssh2-streams@npm:*":
version: 0.1.8
resolution: "@types/ssh2-streams@npm:0.1.8"
@@ -19430,6 +19438,17 @@ __metadata:
languageName: node
linkType: hard
"@types/webpack-sources@npm:^3.2.3":
version: 3.2.3
resolution: "@types/webpack-sources@npm:3.2.3"
dependencies:
"@types/node": "*"
"@types/source-list-map": "*"
source-map: ^0.7.3
checksum: 7b557f242efaa10e4e3e18cc4171a0c98e22898570caefdd4f7b076fe8534b5abfac92c953c6604658dcb7218507f970230352511840fe9fdea31a9af3b9a906
languageName: node
linkType: hard
"@types/webpack@npm:^5.28.0":
version: 5.28.5
resolution: "@types/webpack@npm:5.28.5"