Skip to content

Commit

Permalink
chore(web): change to generate the default dist folder
Browse files Browse the repository at this point in the history
  • Loading branch information
hongbo-miao committed Jan 6, 2025
1 parent 478ff8c commit d91a972
Show file tree
Hide file tree
Showing 19 changed files with 21 additions and 16 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ web-cypress/cypress/fixtures/example.json
web-cypress/cypress/screenshots
web/.eslintcache
web/.lighthouseci
web/dist
web/public/sitemap.xml
web/storybook-static
web/tmp
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ web-cypress/cypress/fixtures/example.json
web-cypress/cypress/screenshots/**/*
web/.eslintcache
web/.lighthouseci/**/*
web/dist/**/*
web/public/sitemap.xml
web/storybook-static/**/*
web/tmp/**/*
Expand Down
1 change: 1 addition & 0 deletions .markdownlint-cli2.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@
"web-cypress/cypress/screenshots",
"web/.eslintcache",
"web/.lighthouseci",
"web/dist",
"web/public/sitemap.xml",
"web/storybook-static",
"web/tmp"
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ web-cypress/cypress/fixtures/example.json
web-cypress/cypress/screenshots
web/.eslintcache
web/.lighthouseci
web/dist
web/public/sitemap.xml
web/storybook-static
web/tmp
3 changes: 2 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ AllCops:
- 'web-cypress/cypress/fixtures/example.json'
- 'web-cypress/cypress/screenshots/**/*'
- 'web/.eslintcache'
- 'web/.lighthouseci'
- 'web/.lighthouseci/**/*'
- 'web/dist/**/*'
- 'web/public/sitemap.xml'
- 'web/storybook-static/**/*'
- 'web/tmp/**/*'
1 change: 1 addition & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ exclude = [
"web-cypress/cypress/screenshots",
"web/.eslintcache",
"web/.lighthouseci",
"web/dist",
"web/public/sitemap.xml",
"web/storybook-static",
"web/tmp",
Expand Down
1 change: 1 addition & 0 deletions .solhintignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ web-cypress/cypress/fixtures/example.json
web-cypress/cypress/screenshots
web/.eslintcache
web/.lighthouseci
web/dist
web/public/sitemap.xml
web/storybook-static
web/tmp
1 change: 1 addition & 0 deletions .sqlfluffignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ web-cypress/cypress/fixtures/example.json
web-cypress/cypress/screenshots
web/.eslintcache
web/.lighthouseci
web/dist
web/public/sitemap.xml
web/storybook-static
web/tmp
1 change: 1 addition & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ web-cypress/cypress/fixtures/example.json
web-cypress/cypress/screenshots
web/.eslintcache
web/.lighthouseci
web/dist
web/public/sitemap.xml
web/storybook-static
web/tmp
1 change: 1 addition & 0 deletions .textlintignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ web-cypress/cypress/fixtures/example.json
web-cypress/cypress/screenshots/**/*
web/.eslintcache
web/.lighthouseci
web/dist
web/public/sitemap.xml
web/storybook-static/**/*
web/tmp/**/*
1 change: 1 addition & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ ignore: |
web-cypress/cypress/screenshots
web/.eslintcache
web/.lighthouseci
web/dist
web/public/sitemap.xml
web/storybook-static
web/tmp
Expand Down
6 changes: 2 additions & 4 deletions api-node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ FROM web-base AS web-builder
COPY ["web/package.json", "web/package-lock.json", "web/.npmrc", "./"]
RUN npm ci
COPY web ./
# Skip lint check during react-scripts build
RUN rm -f ./.eslintrc.js \
&& npm run build \
RUN npm run build \
&& npm prune --production

FROM docker.io/node:22.12.0-alpine AS api-node-base
Expand All @@ -17,7 +15,7 @@ FROM api-node-base AS api-node-builder
COPY ["api-node/package.json", "api-node/package-lock.json", "api-node/.npmrc", "./"]
RUN npm ci
COPY api-node ./
COPY --from=web-builder /usr/src/app/build ./public
COPY --from=web-builder /usr/src/app/dist ./public
RUN npm run build \
&& npm prune --production

Expand Down
2 changes: 1 addition & 1 deletion api-node/Dockerfile.development
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ WORKDIR /usr/src/app
FROM api-node-base AS api-node-builder
COPY ["api-node/package.json", "api-node/package-lock.json", "api-node/.npmrc", "./"]
RUN npm ci
COPY --from=web-builder /usr/src/app/build ./public
COPY --from=web-builder /usr/src/app/dist ./public
COPY api-node ./
EXPOSE 58136
CMD ["npm", "run", "dev"]
2 changes: 1 addition & 1 deletion api-node/bin/build_web.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ npm install
npm run build

cd ..
cp -R web/build/ api-node/public/
cp -R web/dist/ api-node/public/
2 changes: 1 addition & 1 deletion caddy/bin/build_web.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ npm install
npm run build

cd ..
cp -R web/build/ caddy/public/
cp -R web/dist/ caddy/public/
1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export default [
'web-cypress/cypress/screenshots',
'web/.eslintcache',
'web/.lighthouseci',
'web/dist',
'web/public/sitemap.xml',
'web/storybook-static',
'web/tmp',
Expand Down
6 changes: 2 additions & 4 deletions web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ FROM base AS builder
COPY ["web/package.json", "web/package-lock.json", "web/.npmrc", "./"]
RUN npm ci
COPY web ./
# Skip lint check during react-scripts build
RUN rm -f ./.eslintrc.js \
&& npm run build \
RUN npm run build \
&& npm prune --production

FROM docker.io/nginx:1.27.3-alpine AS release
COPY --from=builder /usr/src/app/build /usr/share/nginx/html
COPY --from=builder /usr/src/app/dist /usr/share/nginx/html
COPY web/conf/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD [ "nginx", "-g", "daemon off;" ]
2 changes: 1 addition & 1 deletion web/lighthouserc.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
ci: {
collect: {
staticDistDir: './build',
staticDistDir: './dist',
},
assert: {
preset: 'lighthouse:recommended',
Expand Down
3 changes: 0 additions & 3 deletions web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import { defineConfig } from 'vite';
// https://vite.dev/config
export default defineConfig({
plugins: [react()],
build: {
outDir: 'build',
},
server: {
port: 62470,
},
Expand Down

0 comments on commit d91a972

Please sign in to comment.