@genesislcap/blank-app-seed 3.30.0-prerelease.2 → 3.30.0-prerelease.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.genx/package.json +1 -1
- package/.genx/prompts/api.js +2 -9
- package/.genx/static.js +0 -1
- package/.genx/templates/react/chart.hbs +7 -3
- package/.genx/templates/react/component/component.column.defs.hbs +4 -2
- package/.genx/templates/react/component/component.create.form.hbs +2 -2
- package/.genx/templates/react/component/component.gridOptions.hbs +4 -2
- package/.genx/templates/react/component/component.hbs +64 -27
- package/.genx/templates/react/component/component.index.hbs +1 -1
- package/.genx/templates/react/component/component.update.form.hbs +1 -1
- package/.genx/templates/react/entityManager.hbs +62 -49
- package/.genx/templates/react/form.hbs +7 -3
- package/.genx/templates/react/grid.hbs +16 -10
- package/.genx/templates/react/route.hbs +1 -2
- package/.genx/templates/react/tabsLayout.hbs +5 -5
- package/.genx/utils/generateRoute.js +8 -7
- package/.genx/utils/generateTile.js +31 -16
- package/.genx/versions.json +3 -3
- package/.idea/modules.xml +6 -6
- package/CHANGELOG.md +133 -0
- package/client-tmp/angular/__mocks__/fileMock.js +1 -0
- package/client-tmp/angular/angular.json +0 -29
- package/client-tmp/angular/jest.config.js +20 -0
- package/client-tmp/angular/package.json +6 -6
- package/client-tmp/angular/src/app/layouts/default/default.layout.spec.ts +2 -2
- package/client-tmp/angular/src/jest.setup.ts +46 -0
- package/client-tmp/angular/tsconfig.app.json +1 -2
- package/client-tmp/angular/tsconfig.json +1 -2
- package/client-tmp/angular/tsconfig.spec.json +13 -7
- package/client-tmp/react/.babelrc +10 -0
- package/client-tmp/react/.eslintrc.cjs +1 -0
- package/client-tmp/react/jest.config.ts +15 -0
- package/client-tmp/react/jest.setup.ts +1 -0
- package/client-tmp/react/lint-css.ts +19 -0
- package/client-tmp/react/package.json +40 -15
- package/client-tmp/react/public/favicon.ico +0 -0
- package/client-tmp/react/public/index.html +13 -0
- package/client-tmp/react/src/App.tsx +95 -68
- package/client-tmp/react/src/components/{ErrorMessage.test.js → ErrorMessage/ErrorMessage.test.tsx} +31 -16
- package/client-tmp/react/src/components/ErrorMessage/{ErrorMessage.jsx → ErrorMessage.tsx} +9 -4
- package/client-tmp/react/src/config.ts +2 -16
- package/client-tmp/react/src/custom-elements.d.ts +21 -9
- package/client-tmp/react/src/environments/environment.prod.ts +8 -0
- package/client-tmp/react/src/environments/environment.ts +9 -0
- package/client-tmp/react/src/guards/ProtectedGuard.tsx +64 -0
- package/client-tmp/react/src/helpers/hasPermissionHelper.tsx +10 -0
- package/client-tmp/react/src/helpers/isAuthenticatedHelper.tsx +14 -0
- package/client-tmp/react/src/helpers/isConnectedHelper.tsx +16 -0
- package/client-tmp/react/src/layouts/blank/BlankLayout.tsx +1 -1
- package/client-tmp/react/src/layouts/default/DefaultLayout.tsx +26 -15
- package/client-tmp/react/src/main.tsx +21 -5
- package/client-tmp/react/src/pages/AuthPage/AuthPage.test.tsx +10 -0
- package/client-tmp/react/src/pages/AuthPage/{AuthPage.jsx → AuthPage.tsx} +3 -2
- package/client-tmp/react/src/pages/NotFoundPage/NotFoundPage.css +0 -0
- package/client-tmp/react/src/pages/NotFoundPage/NotFoundPage.tsx +14 -0
- package/client-tmp/react/src/pages/NotPermittedPage/NotPermittedPage.test.tsx +17 -0
- package/client-tmp/react/src/pages/NotPermittedPage/NotPermittedPage.tsx +14 -0
- package/client-tmp/react/src/pbc/README.md +7 -0
- package/client-tmp/react/src/pbc/container.tsx +44 -0
- package/client-tmp/react/src/pbc/elementsRenderer.tsx +40 -0
- package/client-tmp/react/src/pbc/utils.ts +121 -0
- package/client-tmp/react/src/services/store.service.ts +48 -0
- package/client-tmp/react/src/share/foundation-login.ts +13 -6
- package/client-tmp/react/src/share/genesis-components.ts +49 -23
- package/client-tmp/react/src/store/AuthContext.tsx +0 -2
- package/client-tmp/react/src/store/RoutesContext.tsx +74 -0
- package/client-tmp/react/src/types/LayoutName.ts +3 -0
- package/client-tmp/react/src/types/RouteLayouts.ts +3 -1
- package/client-tmp/react/src/utils/getLayoutNameByRoute.ts +5 -0
- package/client-tmp/react/src/utils/history.ts +4 -2
- package/client-tmp/react/src/utils/index.ts +2 -1
- package/client-tmp/react/test/e2e/fixture.ts +1 -1
- package/client-tmp/react/tsconfig.app.json +2 -26
- package/client-tmp/react/tsconfig.json +31 -8
- package/client-tmp/react/tsconfig.node.json +1 -1
- package/client-tmp/react/vite.config.ts +70 -0
- package/client-tmp/react/webpack.config.js +103 -0
- package/client-tmp/web-components/src/main/main.styles.ts +1 -1
- package/package.json +1 -1
- package/server/settings.gradle.kts +2 -2
- package/client-tmp/angular/karma.conf.js +0 -9
- package/client-tmp/angular/src/app/app.component.spec.ts +0 -23
- package/client-tmp/react/env.development.json +0 -3
- package/client-tmp/react/lint-css.js +0 -18
- package/client-tmp/react/src/guards/AuthGuard.tsx +0 -32
- package/client-tmp/react/src/guards/PermissionsGuard.tsx +0 -37
- package/client-tmp/react/src/index.js +0 -17
- package/client-tmp/react/src/pages/NotPermittedPage/NotPermittedPage.jsx +0 -13
- package/client-tmp/react/src/reportWebVitals.js +0 -13
- package/client-tmp/react/vite.config.js +0 -59
- /package/client-tmp/react/src/{setupTests.js → setupTests.ts} +0 -0
- /package/server/{{appName}}-app/src/main/genesis/scripts/{{{appName}}-data-pipelines.kts → {{appName}}-pipelines.kts} +0 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url';
|
|
2
|
+
import { resolve, dirname } from 'path';
|
|
3
|
+
import { defineConfig, UserConfig } from 'vite';
|
|
4
|
+
import react from '@vitejs/plugin-react';
|
|
5
|
+
import visualizer from 'rollup-plugin-visualizer';
|
|
6
|
+
import tsconfigPaths from 'vite-plugin-tsconfig-paths';
|
|
7
|
+
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
|
|
10
|
+
export default defineConfig(({ mode }: { mode: string }): UserConfig => {
|
|
11
|
+
const https: boolean = process.env.HTTPS === 'true';
|
|
12
|
+
const open: boolean = !(process.env.NO_OPEN === 'true');
|
|
13
|
+
const environmentFile = mode === 'production'
|
|
14
|
+
? 'environment.prod.ts'
|
|
15
|
+
: 'environment.ts';
|
|
16
|
+
const environmentPath = resolve(__dirname, 'src/environments', environmentFile);
|
|
17
|
+
|
|
18
|
+
const config: UserConfig = {
|
|
19
|
+
define: {
|
|
20
|
+
BUILDER: JSON.stringify('vite'),
|
|
21
|
+
},
|
|
22
|
+
server: {
|
|
23
|
+
https,
|
|
24
|
+
open,
|
|
25
|
+
fs: {
|
|
26
|
+
strict: false,
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
plugins: [
|
|
30
|
+
react(),
|
|
31
|
+
tsconfigPaths(),
|
|
32
|
+
],
|
|
33
|
+
build: {
|
|
34
|
+
rollupOptions: {
|
|
35
|
+
plugins: [],
|
|
36
|
+
treeshake: false,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
resolve: {
|
|
40
|
+
alias: {
|
|
41
|
+
'foundationZero/ZeroDesignSystem': resolve(__dirname, 'node_modules/@genesislcap/foundation-zero'),
|
|
42
|
+
'@': resolve(__dirname, 'src'),
|
|
43
|
+
'@environment': environmentPath,
|
|
44
|
+
'pbc': resolve(__dirname, 'src/pbc'),
|
|
45
|
+
},
|
|
46
|
+
preserveSymlinks: true,
|
|
47
|
+
},
|
|
48
|
+
esbuild: {
|
|
49
|
+
tsconfigRaw: {
|
|
50
|
+
compilerOptions: {
|
|
51
|
+
experimentalDecorators: true,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
if (mode === 'stats') {
|
|
58
|
+
config.build.rollupOptions.plugins.push(
|
|
59
|
+
visualizer({
|
|
60
|
+
template: 'raw-data',
|
|
61
|
+
filename: 'stats.json',
|
|
62
|
+
open: true,
|
|
63
|
+
gzipSize: true,
|
|
64
|
+
brotliSize: true,
|
|
65
|
+
})
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return config;
|
|
70
|
+
});
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
const { resolve, join } = require('path');
|
|
2
|
+
const webpack = require('webpack');
|
|
3
|
+
const Dotenv = require('dotenv-webpack');
|
|
4
|
+
|
|
5
|
+
module.exports = (env, argv) => {
|
|
6
|
+
const mode = argv.mode || 'development';
|
|
7
|
+
const https = process.env.HTTPS === 'true';
|
|
8
|
+
const open = !(process.env.NO_OPEN === 'true');
|
|
9
|
+
const environmentFile = mode === 'production'
|
|
10
|
+
? 'environment.prod.ts'
|
|
11
|
+
: 'environment.ts';
|
|
12
|
+
const environmentPath = resolve(__dirname, 'src/environments', environmentFile);
|
|
13
|
+
|
|
14
|
+
return {
|
|
15
|
+
mode,
|
|
16
|
+
entry: './src/main.tsx',
|
|
17
|
+
output: {
|
|
18
|
+
path: resolve(__dirname, 'dist'),
|
|
19
|
+
filename: 'bundle.js',
|
|
20
|
+
},
|
|
21
|
+
resolve: {
|
|
22
|
+
extensions: ['.tsx', '.ts', '.js'],
|
|
23
|
+
alias: {
|
|
24
|
+
'foundationZero/ZeroDesignSystem': resolve(__dirname, 'node_modules/@genesislcap/foundation-zero'),
|
|
25
|
+
'@': resolve(__dirname, 'src'),
|
|
26
|
+
'@environment': environmentPath,
|
|
27
|
+
'pbc': resolve(__dirname, 'src/pbc'),
|
|
28
|
+
},
|
|
29
|
+
symlinks: true,
|
|
30
|
+
},
|
|
31
|
+
module: {
|
|
32
|
+
rules: [
|
|
33
|
+
{
|
|
34
|
+
test: /\.tsx?$/,
|
|
35
|
+
use: {
|
|
36
|
+
loader: 'ts-loader',
|
|
37
|
+
options: {
|
|
38
|
+
transpileOnly: true,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
exclude: /node_modules/,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
test: /\.jsx?$/,
|
|
45
|
+
exclude: /node_modules/,
|
|
46
|
+
use: {
|
|
47
|
+
loader: 'babel-loader',
|
|
48
|
+
options: {
|
|
49
|
+
presets: ['@babel/preset-env', '@babel/preset-react'],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
test: /\.css$/,
|
|
55
|
+
use: ['style-loader', 'css-loader'],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
test: /\.svg$/,
|
|
59
|
+
type: 'asset/resource',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
test: /\.(png|jpe?g|gif)$/i,
|
|
63
|
+
use: [
|
|
64
|
+
{
|
|
65
|
+
loader: 'file-loader',
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
plugins: [
|
|
72
|
+
new Dotenv(),
|
|
73
|
+
new webpack.DefinePlugin({
|
|
74
|
+
BUILDER: JSON.stringify('webpack'),
|
|
75
|
+
}),
|
|
76
|
+
],
|
|
77
|
+
devServer: {
|
|
78
|
+
server: https ? 'https' : 'http',
|
|
79
|
+
open,
|
|
80
|
+
static: {
|
|
81
|
+
directory: join(__dirname, 'public'),
|
|
82
|
+
},
|
|
83
|
+
client: {
|
|
84
|
+
overlay: {
|
|
85
|
+
errors: false,
|
|
86
|
+
warnings: false,
|
|
87
|
+
runtimeErrors: false,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
compress: true,
|
|
91
|
+
port: 3000,
|
|
92
|
+
historyApiFallback: true,
|
|
93
|
+
},
|
|
94
|
+
stats: {
|
|
95
|
+
all: false,
|
|
96
|
+
errors: true,
|
|
97
|
+
warnings: true,
|
|
98
|
+
timings: true,
|
|
99
|
+
assets: true,
|
|
100
|
+
modules: false,
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
};
|
package/package.json
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
rootProject.name = "genesisproduct-{{appName}}"
|
|
2
|
-
|
|
3
1
|
pluginManagement {
|
|
4
2
|
pluginManagement {
|
|
5
3
|
val genesisVersion: String by settings
|
|
@@ -38,6 +36,8 @@ plugins {
|
|
|
38
36
|
}
|
|
39
37
|
|
|
40
38
|
genesis {
|
|
39
|
+
productName = "{{appName}}"
|
|
40
|
+
|
|
41
41
|
dependencies {
|
|
42
42
|
dependency("global.genesis:auth:${extra.properties["authVersion"]}")
|
|
43
43
|
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { TestBed } from '@angular/core/testing';
|
|
2
|
-
import { AppComponent } from './app.component';
|
|
3
|
-
|
|
4
|
-
describe('AppComponent', () => {
|
|
5
|
-
beforeEach(async () => {
|
|
6
|
-
await TestBed.configureTestingModule({
|
|
7
|
-
declarations: [AppComponent],
|
|
8
|
-
}).compileComponents();
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
it('should create the app', () => {
|
|
12
|
-
const fixture = TestBed.createComponent(AppComponent);
|
|
13
|
-
const app = fixture.componentInstance;
|
|
14
|
-
expect(app).toBeTruthy();
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it(`should have the '{{capitalCase appName}}' title`, () => {
|
|
18
|
-
const fixture = TestBed.createComponent(AppComponent);
|
|
19
|
-
const app = fixture.componentInstance;
|
|
20
|
-
expect(app.title).toEqual('{{capitalCase appName}}');
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
const { execSync } = require('child_process');
|
|
2
|
-
const glob = require('glob');
|
|
3
|
-
const path = require('path');
|
|
4
|
-
const cssFiles = glob.sync(path.join(__dirname, '**/*.css'));
|
|
5
|
-
|
|
6
|
-
if (cssFiles.length === 0) {
|
|
7
|
-
console.log('No CSS files found.');
|
|
8
|
-
process.exit(0);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const command = `genx lint -l stylelint ${cssFiles.join(' ')}`;
|
|
12
|
-
|
|
13
|
-
try {
|
|
14
|
-
execSync(command, { stdio: 'inherit' });
|
|
15
|
-
} catch (error) {
|
|
16
|
-
console.error('Error running stylelint:', error);
|
|
17
|
-
process.exit(1);
|
|
18
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState, ReactNode } from 'react';
|
|
2
|
-
import { useAuth } from '../store/AuthContext';
|
|
3
|
-
import { Navigate } from 'react-router-dom';
|
|
4
|
-
import { AUTH_PATH } from '../config';
|
|
5
|
-
interface AuthGuardProps {
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
}
|
|
8
|
-
const AuthGuard: React.FC<AuthGuardProps> = ({ children }: AuthGuardProps) => {
|
|
9
|
-
const { user, checkAuthStatus } = useAuth();
|
|
10
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
11
|
-
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
const verifyAuth = async () => {
|
|
14
|
-
await checkAuthStatus();
|
|
15
|
-
setIsLoading(false);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
verifyAuth();
|
|
19
|
-
}, []);
|
|
20
|
-
|
|
21
|
-
if (isLoading) {
|
|
22
|
-
return <div>Loading...</div>; // Or some loading component
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (!user) {
|
|
26
|
-
return <Navigate to={`/${AUTH_PATH}`} />;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return <>{children}</>;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export default AuthGuard;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState, ReactNode } from 'react';
|
|
2
|
-
import { useNavigate } from 'react-router-dom';
|
|
3
|
-
import { getUser } from '@genesislcap/foundation-user';
|
|
4
|
-
import { NOT_PERMITTED_PATH } from '../config';
|
|
5
|
-
|
|
6
|
-
interface PermissionsGuardProps {
|
|
7
|
-
children: ReactNode;
|
|
8
|
-
permissionCode?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const PermissionsGuard: React.FC<PermissionsGuardProps> = ({ children, permissionCode }: PermissionsGuardProps) => {
|
|
12
|
-
const navigate = useNavigate();
|
|
13
|
-
const [isAuthorized, setIsAuthorized] = useState(false);
|
|
14
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
15
|
-
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
const checkPermission = async () => {
|
|
18
|
-
const user = getUser();
|
|
19
|
-
if (permissionCode && !user.hasPermission(permissionCode)) {
|
|
20
|
-
navigate(`/${NOT_PERMITTED_PATH}`);
|
|
21
|
-
} else {
|
|
22
|
-
setIsAuthorized(true);
|
|
23
|
-
}
|
|
24
|
-
setIsLoading(false);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
checkPermission();
|
|
28
|
-
}, [navigate, permissionCode]);
|
|
29
|
-
|
|
30
|
-
if (isLoading) {
|
|
31
|
-
return <div>Loading...</div>; // Or some loading component
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return isAuthorized ? <>{children}</> : null;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export default PermissionsGuard;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import ReactDOM from 'react-dom/client';
|
|
3
|
-
import './styles/styles.css';
|
|
4
|
-
import App from './App';
|
|
5
|
-
import reportWebVitals from './reportWebVitals';
|
|
6
|
-
|
|
7
|
-
const root = ReactDOM.createRoot(document.getElementById('root'));
|
|
8
|
-
root.render(
|
|
9
|
-
<React.StrictMode>
|
|
10
|
-
<App />
|
|
11
|
-
</React.StrictMode>,
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
// If you want to start measuring performance in your app, pass a function
|
|
15
|
-
// to log results (for example: reportWebVitals(console.log))
|
|
16
|
-
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
|
|
17
|
-
reportWebVitals();
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import ErrorMessage from '../../components/ErrorMessage/ErrorMessage';
|
|
2
|
-
import './NotPermittedPage.css';
|
|
3
|
-
|
|
4
|
-
const NotPermittedPage = () => {
|
|
5
|
-
return (
|
|
6
|
-
<ErrorMessage
|
|
7
|
-
elementType="h1"
|
|
8
|
-
message="You do not have permission to access this part of the application, please contact your administrator."
|
|
9
|
-
></ErrorMessage>
|
|
10
|
-
);
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export default NotPermittedPage;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const reportWebVitals = (onPerfEntry) => {
|
|
2
|
-
if (onPerfEntry && onPerfEntry instanceof Function) {
|
|
3
|
-
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
|
|
4
|
-
getCLS(onPerfEntry);
|
|
5
|
-
getFID(onPerfEntry);
|
|
6
|
-
getFCP(onPerfEntry);
|
|
7
|
-
getLCP(onPerfEntry);
|
|
8
|
-
getTTFB(onPerfEntry);
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export default reportWebVitals;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath } from 'node:url';
|
|
2
|
-
import { resolve, dirname } from 'path';
|
|
3
|
-
import { defineConfig } from 'vite';
|
|
4
|
-
import fs from 'fs';
|
|
5
|
-
import react from '@vitejs/plugin-react';
|
|
6
|
-
import visualizer from 'rollup-plugin-visualizer';
|
|
7
|
-
|
|
8
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
-
|
|
10
|
-
export default defineConfig(({ mode }) => {
|
|
11
|
-
const https = process.env.HTTPS === 'true';
|
|
12
|
-
const open = !(process.env.NO_OPEN === 'true');
|
|
13
|
-
const jsonFilePath = resolve(process.cwd(), `env.${mode}.json`);
|
|
14
|
-
const envConfig = {};
|
|
15
|
-
|
|
16
|
-
if (fs.existsSync(jsonFilePath)) {
|
|
17
|
-
const jsonContent = fs.readFileSync(jsonFilePath, 'utf-8');
|
|
18
|
-
const parsedConfig = JSON.parse(jsonContent);
|
|
19
|
-
|
|
20
|
-
for (const key in parsedConfig) {
|
|
21
|
-
envConfig[`import.meta.env.${key}`] = JSON.stringify(parsedConfig[key]);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const config = {
|
|
26
|
-
define: envConfig,
|
|
27
|
-
server: {
|
|
28
|
-
https,
|
|
29
|
-
open,
|
|
30
|
-
},
|
|
31
|
-
plugins: [
|
|
32
|
-
react(),
|
|
33
|
-
],
|
|
34
|
-
build: {
|
|
35
|
-
rollupOptions: {
|
|
36
|
-
plugins: []
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
resolve: {
|
|
40
|
-
alias: {
|
|
41
|
-
'foundationZero/ZeroDesignSystem': resolve(__dirname, 'node_modules/@genesislcap/foundation-zero'),
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
if (mode === 'stats') {
|
|
47
|
-
config.build.rollupOptions.plugins.push(
|
|
48
|
-
visualizer({
|
|
49
|
-
template: 'raw-data',
|
|
50
|
-
filename: 'stats.json',
|
|
51
|
-
open: true,
|
|
52
|
-
gzipSize: true,
|
|
53
|
-
brotliSize: true,
|
|
54
|
-
})
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return config;
|
|
59
|
-
});
|
|
File without changes
|