diff --git a/.dockerignore b/.dockerignore index 41b87855a..7093c4095 100644 --- a/.dockerignore +++ b/.dockerignore @@ -12,8 +12,8 @@ yarn-error.log* /junit.xml +/dist/ /static/ -/static-test/ /public/ /dist/ diff --git a/.eslintignore b/.eslintignore index 1ab6f8d8c..dc7fe3106 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,6 +1,6 @@ /node_modules/** +/dist/** /static/** -/static-test/** /public/** /tmp/** /coverage/** diff --git a/.gitignore b/.gitignore index e2f59fe19..398028788 100644 --- a/.gitignore +++ b/.gitignore @@ -11,8 +11,8 @@ yarn-error.log* /junit.xml *.timestamp-* +/dist/ /static/ -/static-test/ /public/ /dist/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 81dff9940..213c70c2c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -97,7 +97,7 @@ nginx-test: changes: - "installation/mastodon.conf" -build-production: +build: stage: test script: - yarn build @@ -105,12 +105,12 @@ build-production: # # Fail if files got changed. # # https://stackoverflow.com/a/9066385 # - git diff --quiet - - cp static/index.html static/404.html + - cp dist/index.html dist/404.html variables: NODE_ENV: production artifacts: paths: - - static + - dist/ docs-deploy: stage: deploy @@ -131,7 +131,7 @@ review: name: review/$CI_COMMIT_REF_NAME url: https://$CI_COMMIT_REF_SLUG.git.soapbox.pub script: - - npx -y surge static $CI_COMMIT_REF_SLUG.git.soapbox.pub + - npx -y surge dist $CI_COMMIT_REF_SLUG.git.soapbox.pub allow_failure: true pages: @@ -139,7 +139,7 @@ pages: before_script: [] script: # artifacts are kept between jobs - - mv static public + - mv dist public variables: NODE_ENV: production artifacts: diff --git a/Dockerfile b/Dockerfile index b02bf86e1..2765f2053 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,4 +14,4 @@ ENV FALLBACK_PORT=4444 ENV BACKEND_URL=http://localhost:4444 ENV CSP= COPY installation/docker.conf.template /etc/nginx/templates/default.conf.template -COPY --from=build /app/static /usr/share/nginx/html +COPY --from=build /app/dist /usr/share/nginx/html diff --git a/app/soapbox/build-config-compiletime.ts b/app/soapbox/build-config-compiletime.ts index 38d4b5bbc..6f9cb2aba 100644 --- a/app/soapbox/build-config-compiletime.ts +++ b/app/soapbox/build-config-compiletime.ts @@ -38,7 +38,7 @@ export default () => ({ NODE_ENV: NODE_ENV || 'development', BACKEND_URL: sanitizeURL(BACKEND_URL), FE_SUBDIRECTORY: sanitizeBasename(FE_SUBDIRECTORY), - FE_BUILD_DIR: sanitizePath(FE_BUILD_DIR) || 'static', + FE_BUILD_DIR: sanitizePath(FE_BUILD_DIR) || 'dist', FE_INSTANCE_SOURCE_DIR: FE_INSTANCE_SOURCE_DIR || 'instance', SENTRY_DSN, }, diff --git a/docs/development/build-config.md b/docs/development/build-config.md index 65fa70a95..c00a442fd 100644 --- a/docs/development/build-config.md +++ b/docs/development/build-config.md @@ -155,7 +155,7 @@ Options: - Any directory name, eg `"public"` -Default: `"static"` +Default: `"dist"` ### `FE_SUBDIRECTORY` diff --git a/docs/development/yarn-commands.md b/docs/development/yarn-commands.md index 0180ed89f..6838706fc 100644 --- a/docs/development/yarn-commands.md +++ b/docs/development/yarn-commands.md @@ -12,7 +12,7 @@ NODE_ENV=development - `yarn dev` - Run the local dev server. ## Building -- `yarn build` - Compile without a dev server, into `/static` directory. +- `yarn build` - Compile without a dev server, into `/dist` directory. ## Translations - `yarn i18n` - Rebuilds app and updates English locale to prepare for translations in other languages. Should always be run after editing i18n strings. diff --git a/vite.config.ts b/vite.config.ts index 5c127b4f3..b9369a895 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -14,7 +14,7 @@ export default defineConfig({ root: 'app', build: { // Relative to the root - outDir: '../static', + outDir: '../dist', assetsDir: 'packs', assetsInlineLimit: 0, rollupOptions: {