Skip to content

Commit

Permalink
Fix docker build and replace REACT_APP with VITE_APP #1379
Browse files Browse the repository at this point in the history
  • Loading branch information
joelvdavies committed Mar 15, 2024
1 parent ec83e56 commit 47c20d0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ FROM httpd:2.4-alpine3.15
WORKDIR /usr/local/apache2/htdocs

# Put the output of the build into an apache server
COPY --from=builder /scigateway-build/build/. .
COPY --from=builder /scigateway-build/dist/. .

RUN set -eux; \
\
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
},
"scripts": {
"dev": "cross-env concurrently \"yarn serve:plugins\" \"node server/auth-server.js\" \"vite --open\"",
"dev-without-open": "vite",
"build": "tsc --project tsconfig.build.json && vite build",
"preview": "vite preview",
"preview:build": "yarn build && yarn preview",
Expand Down Expand Up @@ -137,4 +136,4 @@
"wait-on": "7.2.0"
},
"packageManager": "yarn@4.1.0"
}
}
4 changes: 2 additions & 2 deletions src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import Backend from 'i18next-http-backend';
import LanguageDetector from 'i18next-browser-languagedetector';
import { initReactI18next } from 'react-i18next';

const loadPath = process.env.REACT_APP_SCIGATEWAY_BUILD_DIRECTORY
? process.env.REACT_APP_SCIGATEWAY_BUILD_DIRECTORY + 'res/default.json'
const loadPath = process.env.VITE_APP_SCIGATEWAY_BUILD_DIRECTORY
? process.env.VITE_APP_SCIGATEWAY_BUILD_DIRECTORY + 'res/default.json'

Check warning on line 7 in src/i18n.ts

View check run for this annotation

Codecov / codecov/patch

src/i18n.ts#L6-L7

Added lines #L6 - L7 were not covered by tests
: '/res/default.json';

i18n
Expand Down
6 changes: 3 additions & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function jsonHMR(): PluginOption {
}

// https://vitejs.dev/config/
export default defineConfig(({ command, mode }) => {
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');

const plugins: PluginOption[] = [react()];
Expand All @@ -45,9 +45,8 @@ export default defineConfig(({ command, mode }) => {
'process.env.NODE_ENV': JSON.stringify(env.NODE_ENV),
},
test: {
globals: 'true',
globals: true,
environment: 'jsdom',
// globalSetup: './globalSetup.js',
setupFiles: ['src/setupTests.ts'],
coverage: {
exclude: [
Expand All @@ -56,6 +55,7 @@ export default defineConfig(({ command, mode }) => {
'__mocks__/axios.ts',
'micro-frontend-tools/serve-plugins.js',
'.eslintrc.cjs',
'src/vite-env.d.ts',
'src/main.tsx',
],
},
Expand Down

0 comments on commit 47c20d0

Please sign in to comment.