public/

Any static assets can be placed in the public/ directory, and the files will be deployed to the corresponding application domain by the server.

Description

The file routing is based on the convention of the directory structure, where public/ is the root directory corresponding to the root path of the Web application.

For example, the config/public/sdk/index.js file will be deployed under ${domain}/sdk/index.js after deployment.

Scenarios

For example, authentication files required by third-party systems such as robots.txt and auth.xml.

Or SDKs for other business parties (requiring unchanged routing), or HTML files without entry.

INFO

For static assets (such as SVG images) that need to be imported through import in the source code, it is recommended to manage them in the src/assets directory.

Code Compression

If the file in the directory is a .js file, it will be automatically compressed during production environment construction.

If the file ends with .min.js, it will not be compressed.