Skip to content

Commit 74e87c9

Browse files
committed
chore: 🔨 Rollback webpack for production
1 parent acb0dd3 commit 74e87c9

File tree

6 files changed

+191
-1078
lines changed

6 files changed

+191
-1078
lines changed

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default [
1717
eslintConfigPrettier,
1818
pluginPrettierRecommended,
1919
{
20-
ignores: ['**/build', '**/css', '**/*.cjs']
20+
ignores: ['**/build', '**/css', '**/*.mjs']
2121
},
2222

2323
{

package.json

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "skupper-network-console",
3-
"version": "2.0.0-dev",
3+
"version": "2.0.0",
44
"description": "The Network Console for monitoring Skupper metrics and topology.",
55
"repository": "git+https://github.com/skupperproject/skupper-console.git",
66
"author": "The Skupper Team",
@@ -17,9 +17,8 @@
1717
"yarn": ">=1.22 <2.0.0"
1818
},
1919
"scripts": {
20-
"build": "tsc && vite build",
20+
"build": "tsc && webpack --config webpack.config.mjs",
2121
"build:preview": "vite preview",
22-
"build:prod": "tsc && NODE_ENV=production webpack",
2322
"start": "vite --host",
2423
"test": "yarn test:watch --run",
2524
"test:watch": "USE_MOCK_SERVER=true vitest",
@@ -66,10 +65,10 @@
6665
"@vitejs/plugin-react": "^4.3.4",
6766
"@vitest/coverage-v8": "^2.1.8",
6867
"@vitest/eslint-plugin": "^1.1.25",
68+
"circular-dependency-plugin": "^5.2.2",
6969
"commitizen": "^4.3.1",
7070
"copy-webpack-plugin": "^12.0.2",
7171
"css-loader": "^7.1.2",
72-
"css-minimizer-webpack-plugin": "^7.0.0",
7372
"cypress": "^13.17.0",
7473
"cz-git": "^1.11.0",
7574
"eslint": "^9.18.0",
@@ -89,13 +88,9 @@
8988
"start-server-and-test": "^2.0.9",
9089
"terser-webpack-plugin": "^5.3.11",
9190
"ts-loader": "^9.5.2",
92-
"ts-node": "^10.9.2",
9391
"typescript": "^5.7.3",
9492
"typescript-eslint": "^8.20.0",
9593
"vite": "^6.0.7",
96-
"vite-plugin-circular-dependency": "^0.5.0",
97-
"vite-plugin-favicons-inject": "^2.2.0",
98-
"vite-plugin-static-copy": "^2.2.0",
9994
"vitest": "^2.1.8",
10095
"webpack": "^5.97.1",
10196
"webpack-cli": "^6.0.1"

vite.config.ts

Lines changed: 26 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,33 @@
11
import react from '@vitejs/plugin-react';
2-
import { defineConfig, PluginOption } from 'vite';
3-
import circleDependency from 'vite-plugin-circular-dependency';
4-
import vitePluginFaviconsInject from 'vite-plugin-favicons-inject';
5-
import { viteStaticCopy } from 'vite-plugin-static-copy';
2+
import { defineConfig } from 'vite';
63

7-
export default defineConfig(() => {
8-
const outDir = 'build';
4+
export default defineConfig(() => ({
5+
plugins: [react()],
96

10-
return {
11-
plugins: [
12-
react(),
13-
circleDependency(),
14-
process.env.BRAND_FAVICON && vitePluginFaviconsInject(process.env.BRAND_FAVICON),
15-
process.env.BRAND_APP_LOGO &&
16-
viteStaticCopy({
17-
targets: [
18-
{
19-
src: process.env.BRAND_APP_LOGO,
20-
dest: ''
21-
}
22-
]
23-
})
24-
].filter(Boolean) as PluginOption[], // remove conditional plugins if undefined
7+
define: {
8+
'process.env.OBSERVER_URL': JSON.stringify(process.env.OBSERVER_URL || ''),
9+
'process.env.BRAND_APP_LOGO': JSON.stringify(process.env.BRAND_APP_LOGO || ''),
10+
'process.env.API_VERSION': JSON.stringify(process.env.API_VERSION || ''),
11+
'process.env.USE_MOCK_SERVER': JSON.stringify(process.env.USE_MOCK_SERVER),
12+
'process.env.MOCK_ITEM_COUNT': JSON.stringify(process.env.MOCK_ITEM_COUNT),
13+
'process.env.MOCK_RESPONSE_DELAY': JSON.stringify(process.env.MOCK_RESPONSE_DELAY)
14+
},
2515

26-
define: {
27-
'process.env.OBSERVER_URL': JSON.stringify(process.env.OBSERVER_URL || ''),
28-
'process.env.BRAND_APP_LOGO': JSON.stringify(process.env.BRAND_APP_LOGO || ''),
29-
'process.env.API_VERSION': JSON.stringify(process.env.API_VERSION || ''),
30-
'process.env.USE_MOCK_SERVER': JSON.stringify(process.env.USE_MOCK_SERVER),
31-
'process.env.MOCK_ITEM_COUNT': JSON.stringify(process.env.MOCK_ITEM_COUNT),
32-
'process.env.MOCK_RESPONSE_DELAY': JSON.stringify(process.env.MOCK_RESPONSE_DELAY)
33-
},
16+
base: './',
3417

35-
base: './',
18+
server: {
19+
port: 3000
20+
},
3621

37-
build: {
38-
outDir,
39-
emptyOutDir: true,
40-
sourcemap: true,
41-
chunkSizeWarningLimit: 1500
42-
},
43-
44-
server: {
45-
port: 3000
46-
},
47-
48-
test: {
49-
globals: true,
50-
environment: 'jsdom',
51-
setupFiles: ['./vite.setup.ts'],
52-
coverage: {
53-
reporter: ['text', 'lcov'],
54-
all: false,
55-
include: ['**/src/**'],
56-
exclude: ['**/src/config/**']
57-
}
22+
test: {
23+
globals: true,
24+
environment: 'jsdom',
25+
setupFiles: ['./vite.setup.ts'],
26+
coverage: {
27+
reporter: ['text', 'lcov'],
28+
all: false,
29+
include: ['**/src/**'],
30+
exclude: ['**/src/config/**']
5831
}
59-
};
60-
});
32+
}
33+
}));

webpack.config.cjs

Lines changed: 0 additions & 140 deletions
This file was deleted.

0 commit comments

Comments
 (0)