Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add the user-defined output.assetPrefix config for the node mode of modern deploy #6075

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Gk0Wk
Copy link

@Gk0Wk Gk0Wk commented Aug 14, 2024

Summary

When using modern deploy, the project's configured output.assetPrefix is ignored, which results in static resource files failing to be accessed in the Node.js deployment mode.

For example, if the user configures assetPrefix as /foo, the URLs for the generated static resource files will start with /foo/static. However, if this configuration is ignored in the generated .output/index.js, the production server will continue to expect static resources to be prefixed with /static, leading to failures in accessing the static resource files.

Checklist

  • I have added changeset via pnpm run change.
  • I have updated the documentation.
  • I have added tests to cover my changes.

Copy link

changeset-bot bot commented Aug 14, 2024

🦋 Changeset detected

Latest commit: a5295cb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 280 packages
Name Type
@modern-js/app-tools Major
@modern-js/plugin-bff Major
@modern-js/plugin-ssg Major
@modern-js/plugin-swc Major
@modern-js/plugin-tailwindcss Major
@modern-js/devtools-client Major
@modern-js/devtools-kit Major
@modern-js/plugin-devtools Major
@modern-js/plugin-garfish Major
@modern-js/plugin-router-v5 Major
@modern-js/runtime Major
@modern-js/plugin-express Major
@modern-js/plugin-koa Major
@modern-js/plugin-polyfill Major
@modern-js/plugin-server Major
@modern-js/plugin-worker Major
tests Major
@integration-test/alias-set Major
api-service-koa Major
app-docmuent Major
integration-asset-prefix Major
async-entry-test Major
tmp Major
bff-express Major
bff-koa Major
integration-builder-plugins Major
integration-clean-dist-path Major
integration-compatibility Major
integration-copy-assets Major
integration-custom-dist-path Major
custom-file-system-entry Major
integration-custom-render Major
integration-custom-template Major
deploy Major
deploy-server Major
dev-server Major
@integration-test/devtools Major
integration-disable-html Major
entries-app-builder Major
app-custom-bootstrap Major
app-custom-routes-runtime Major
app-custom Major
app-entry Major
app-route Major
esbuild-transform-and-minify Major
app-garfish-dashboard Major
app-garfish-master Major
app-garfish-table Major
integration-config-async-config-test Major
integration-basic-local-config Major
integration-config-function-params Major
integration-local-config-function Major
main-entry-name Major
nonce Major
routes-match Major
routes Major
runtime-custom-plugin Major
runtime-custom-config-plugin Major
file-based-router Major
use-loader Major
select-mul-entry-test Major
select-one-entry-test Major
server-config-v2 Major
server-config Major
server-middleware Major
server-new-middleware Major
server-hook-reqeust Major
server-hook-response Major
server-hook-router Major
@integration-test/server-hook-reqeust Major
server-prod Major
server-routes Major
@source-code-build/app-ts-loader Major
@source-code-build/app Major
ssg-fixtures-nested-routes Major
ssg-fixtures-simple Major
ssg-fixtures-web-server Major
ssr-base-json-test Major
ssr-base-test Major
ssr-base-fallback-test Major
init Major
ssr-inline Major
ssr-partial-test Major
ssr-preload Major
ssr-script-loading Major
ssr-streaming-test Major
swc-test-decorator-legacy Major
swc-test-decorator Major
swc-minify-css Major
swc-minify-js Major
transform-fail Major
integration-tailwindcss-v2 Major
integration-tailwindcss-v3-js-config Major
integration-tailwindcss-v3-merge-config Major
integration-tailwindcss-v3-ts-config Major
integration-tailwindcss-v3 Major
twin-macro-v2 Major
twin-macro-v3 Major
tmp-dir Major
transform-import-type-test Major
write-to-dist Major
@e2e/garfish-dashboard-router-v6 Major
@e2e/garfish-dashboard Major
@e2e/garfish-main-router-v6 Major
@e2e/garfish-main Major
@e2e/garfish-table Major
@modern-js/babel-preset Major
@modern-js/core Major
@modern-js/doc-plugin-auto-sidebar Major
@modern-js/plugin-changeset Major
@modern-js/plugin-data-loader Major
@modern-js/plugin-i18n Major
@modern-js/plugin-lint Major
@modern-js/plugin-proxy Major
@modern-js/rsbuild-plugin-esbuild Major
@modern-js/uni-builder Major
@modern-js/builder-doc Major
@modern-js/main-doc Major
@modern-js/module-tools-docs Major
@modern-js/plugin-testing Major
@modern-js/new-action Major
@modern-js/sandpack-react Major
@modern-js-app/eslint-config Major
@modern-js/eslint-config Major
@modern-js/tsconfig Major
@modern-js/babel-plugin-module-resolver Major
@modern-js/bff-core Major
@modern-js/bff-runtime Major
@modern-js/server-core Major
@modern-js/create-request Major
@modern-js/prod-server Major
@modern-js/server Major
@modern-js/server-utils Major
@modern-js/plugin-module-babel Major
@modern-js/plugin-module-banner Major
@modern-js/plugin-module-import Major
@modern-js/plugin-module-node-polyfill Major
@modern-js/plugin-module-polyfill Major
@modern-js/plugin-module-vue Major
@modern-js/module-tools Major
@modern-js/monorepo-tools Major
@modern-js/create Major
@modern-js/e2e Major
@modern-js/node-bundle-require Major
@modern-js/plugin Major
@modern-js/runtime-utils Major
@modern-js/types Major
@modern-js/upgrade Major
@modern-js/utils Major
@modern-js/babel-compiler Major
@modern-js/storybook-builder Major
@modern-js/storybook Major
@scripts/build Major
@scripts/check-changeset Major
@scripts/jest-config Major
@scripts/lint-package-json Major
@scripts/prebundle Major
@scripts/update-codesmith Major
@scripts/update-rsbuild Major
@scripts/update-rspress Major
@scripts/vitest-config Major
entries-integration Major
esbuild-integration Major
integration-load-config Major
alias-js-test Major
alias-module-id-test Major
alias-ts-test Major
asset-limit-test Major
asset-name-test Major
asset-path-test Major
asset-publicPath-test Major
svgr-test Major
auto-extension-commonjs-test Major
auto-extension-type-module-test Major
auto-external-test Major
banner-footer-test Major
build-type-test Major
copy-test Major
decorator-test Major
global-vars-js-test Major
global-vars-ts-test Major
dts-composite Major
dts-test Major
esbuild-options-test Major
external-test Major
format-cjs-test Major
format-esm-test Major
format-iife-test Major
format-umd-test Major
hook-test Major
entry-test Major
jsx-test Major
loader-esbuild-test Major
loader-swc-test Major
metafile-test Major
minify-test Major
platform-test Major
redirect-test Major
resolve-alias-error Major
resolve-alias-test Major
data-url-test Major
browser-false Major
resolve-false Major
ndoe-protocol-test Major
lib1 Major
lib2 Major
lib3 Major
condition-exports-test Major
js-extensions-test Major
main-fields-test Major
shims-test Major
module-tools-side-effects-test Major
source-dir-test Major
sourcemap-test Major
splitting-test Major
css-test Major
less-test Major
style-test Major
postcss-test Major
sass-test Major
tailwindcss-test Major
target-test Major
transform-import Major
transform-lodash Major
tsconfig-test Major
tsconfig-extends-test Major
umdGlobals-test Major
get-module-id-test Major
dev-test Major
build-platform-test Major
build-preset-error-test Major
build-preset-function-test Major
build-preset-test Major
build-preset-string-test Major
integration-module-tools Major
plugin-babel Major
module-hooks-test Major
plugin-node-polyfill Major
plugin-polyfill Major
plugin-vue Major
runtime Major
entry Major
@source-code-build/common Major
@source-code-build/components Major
@source-code-build/utils Major
ssg Major
ssr Major
integration-tests-storybook Major
swc-integration Major
tailwindcss-integration-test Major
@e2e/webpack-builder-import-antd-v4 Major
@e2e/webpack-builder-import-antd-v5 Major
@e2e/webpack-builder-import-arco Major
@e2e/webpack-builder-test-moment Major
@e2e/builder-remove-prop-types Major
@e2e/webpack-builder-source-map Major
@e2e/builder Major
@e2e/garfish Major
@modern-js/generator-common Patch
@modern-js/generator-plugin Patch
@modern-js/generator-utils Patch
@modern-js/bff-generator Patch
@modern-js/dependence-generator Patch
@modern-js/entry-generator Patch
@modern-js/generator-generator Patch
@modern-js/module-doc-generator Patch
@modern-js/module-generator Patch
@modern-js/mwa-generator Patch
@modern-js/router-v5-generator Patch
@modern-js/ssg-generator Patch
@modern-js/storybook-next-generator Patch
@modern-js/upgrade-generator Patch
@modern-js/generator-plugin-plugin Patch
@modern-js/base-generator Patch
@modern-js/changeset-generator Patch
@modern-js/packages-generator Patch
@modern-js/repo-generator Patch
@modern-js/server-generator Patch
@modern-js/tailwindcss-generator Patch
@modern-js/generator-cases Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

netlify bot commented Aug 14, 2024

Deploy Preview for modernjs-byted ready!

Name Link
🔨 Latest commit a5295cb
🔍 Latest deploy log https://app.netlify.com/sites/modernjs-byted/deploys/66bc6b8786ffbc0008884495
😎 Deploy Preview https://deploy-preview-6075--modernjs-byted.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 76 (🟢 up 2 from production)
Accessibility: 90 (no change from production)
Best Practices: 100 (no change from production)
SEO: 83 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@yimingjfe
Copy link
Member

Thank you for your PR. Have you encountered this problem in a real project before? Because Modern.js will serialize the modern.config.ts to server and I also didn't reproduce the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants