diff --git a/client/index.html b/client/index.html index 7c9cbdb7e..f289d2c7d 100644 --- a/client/index.html +++ b/client/index.html @@ -2,43 +2,144 @@ + <% if (env.VITE_APP_INSTANCE === 'IMEX') { %> + <% } %> <% if (env.VITE_APP_INSTANCE === 'ROME') { %> + + <% } %> <% if (env.VITE_APP_INSTANCE === 'PROMANAGER') { %> + + <% } %> + - + + + + <% if (env.VITE_APP_INSTANCE === 'IMEX') { %> + + ImEX Online + <% } %> <% if (env.VITE_APP_INSTANCE === 'ROME') { %> + + Rome Online + + + + + + + + + + + + + + <% } %> <% if (env.VITE_APP_INSTANCE === 'PROMANAGER') { %> + ProManager + + + <% } %> - - - - - ImEX Online diff --git a/client/package-lock.json b/client/package-lock.json index 26c1a843b..06cb6ca6e 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -86,6 +86,7 @@ "styled-components": "^6.1.8", "subscriptions-transport-ws": "^0.11.0", "terser-webpack-plugin": "^5.3.10", + "vite-plugin-ejs": "^1.7.0", "vite-plugin-svgr": "^4.2.0", "web-vitals": "^3.5.2", "workbox-core": "^7.0.0", @@ -26836,6 +26837,17 @@ "vite": "^2.7.0 || ^3.0.0 || ^4.0.0 || ^5.0.0" } }, + "node_modules/vite-plugin-ejs": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/vite-plugin-ejs/-/vite-plugin-ejs-1.7.0.tgz", + "integrity": "sha512-JNP3zQDC4mSbfoJ3G73s5mmZITD8NGjUmLkq4swxyahy/W0xuokK9U9IJGXw7KCggq6UucT6hJ0p+tQrNtqTZw==", + "dependencies": { + "ejs": "^3.1.9" + }, + "peerDependencies": { + "vite": ">=5.0.0" + } + }, "node_modules/vite-plugin-legacy": { "version": "2.1.0", "dev": true, diff --git a/client/package.json b/client/package.json index d0ec460dd..75c7de5b6 100644 --- a/client/package.json +++ b/client/package.json @@ -86,6 +86,7 @@ "styled-components": "^6.1.8", "subscriptions-transport-ws": "^0.11.0", "terser-webpack-plugin": "^5.3.10", + "vite-plugin-ejs": "^1.7.0", "vite-plugin-svgr": "^4.2.0", "web-vitals": "^3.5.2", "workbox-core": "^7.0.0", @@ -139,8 +140,8 @@ }, "devDependencies": { "@babel/plugin-proposal-private-property-in-object": "^7.21.11", - "@dotenvx/dotenvx": "^0.15.0", "@babel/preset-react": "^7.23.3", + "@dotenvx/dotenvx": "^0.15.0", "@emotion/babel-plugin": "^11.11.0", "@emotion/react": "^11.11.3", "@sentry/webpack-plugin": "^2.14.2", diff --git a/client/src/components/header/header.component.jsx b/client/src/components/header/header.component.jsx index 23d73b203..d032c6082 100644 --- a/client/src/components/header/header.component.jsx +++ b/client/src/components/header/header.component.jsx @@ -378,7 +378,7 @@ function Header({ ...(InstanceRenderManager({ imex: true, rome: true, - promanager: HasFeatureAccess({ featureName: 'courtesycards', bodyshop }), + promanager: false// HasFeatureAccess({ featureName: 'courtesycars', bodyshop }), }) ? [ { diff --git a/client/vite.config.js b/client/vite.config.js index d359385af..b1045eebc 100644 --- a/client/vite.config.js +++ b/client/vite.config.js @@ -1,19 +1,10 @@ -import legacy from '@vitejs/plugin-legacy'; import react from '@vitejs/plugin-react'; -import { createRequire } from 'module'; -import { defineConfig, transformWithEsbuild } from 'vite'; import { promises as fsPromises } from 'fs'; -import * as url from 'url'; +import { createRequire } from 'module'; import * as path from 'path'; -import { nodePolyfills } from 'vite-plugin-node-polyfills'; -import { - AndDesignVueResolve, - AntdResolve, - createStyleImportPlugin, - ElementPlusResolve, - NutuiResolve, - VantResolve, -} from 'vite-plugin-style-import'; +import * as url from 'url'; +import { defineConfig } from 'vite'; +import { ViteEjsPlugin } from 'vite-plugin-ejs'; process.env.VITE_APP_GIT_SHA_DATE = new Date().toLocaleString('en-US', { timeZone: 'America/Los_Angeles', @@ -44,88 +35,24 @@ function reactVirtualized() { export default defineConfig({ base: '/', plugins: [ - // { - // name: 'treat-js-files-as-jsx', - // async transform(code, id) { - // if (!id.match(/src\/.*\.js$/)) return null + ViteEjsPlugin((viteConfig) => { + // viteConfig is the current Vite resolved config + return { env: viteConfig.env }; + }), - // return transformWithEsbuild(code, id, { - // loader: 'jsx', - // jsx: 'automatic', - // }) - // }, - // }, reactVirtualized(), react(), - // nodePolyfills({ - // protocolImports: true, - // overrides: { - // // Since `fs` is not supported in browsers, we can use the `memfs` package to polyfill it. - // fs: 'memfs', - // // Since `path` is not supported in browsers, we can use the `path-browserify` package to polyfill it. - // path: 'path-browserify', - // // Since `os` is not supported in browsers, we can use the `os-browserify` package to polyfill it. - // os: 'os-browserify/browser', - // // Since `crypto` is not supported in browsers, we can use the `crypto-browserify` package to polyfill it. - // crypto: 'crypto-browserify', - // // Since `stream` is not supported in browsers, we can use the `stream-browserify` package to polyfill it. - // stream: 'stream-browserify', - // // Since `buffer` is not supported in browsers, we can use the `buffer` package to polyfill it. - - // } - // }), - // createStyleImportPlugin({ - // resolves: [ - // AndDesignVueResolve(), - // VantResolve(), - // ElementPlusResolve(), - // NutuiResolve(), - // AntdResolve(), - // ], - // libs: [ - // { - // libraryName: 'ant-design-vue', - // esModule: true, - // resolveStyle: (name) => { - // return `ant-design-vue/es/${name}/style/index` - // }, - // }, - // ] - // }), - // legacy({ - // targets: ['defaults'] - // }), ], - // css: { - // preprocessorOptions: { - // less: { - // javascriptEnabled: true, - // modifyVars: { - // ...v4Token, - // }, - - // } - // } - // }, server: { host: true, port: 3000, open: true, }, optimizeDeps: { - // force: true, esbuildOptions: { loader: { '.js': 'jsx', }, }, }, - // build: { - // outDir: 'build', - // // manifest: true, - // // sourcemap: true, - // // rollupOptions: { - // // external: ['antd'], - // // }, - // } });