Home > @lynx-js/rspeedy > Output > assetPrefix

Output.assetPrefix property

The Output.assetPrefix is used to set the URL prefix for static assets.

Signature:

assetPrefix?: string | undefined;

Remarks

The functionality of Output.assetPrefix is basically the same as the output.publicPath config in Rspack. With the following differences:

  • output.assetPrefix only takes effect in the production build.

  • output.assetPrefix automatically appends a trailing / by default.

  • The value of output.assetPrefix is written to the process.env.ASSET_PREFIX environment variable.

Example

import { defineConfig } from '@lynx-js/rspeedy'
export default defineConfig({
  output: {
    assetPrefix: 'https://cdn.example.com/assets/',
  },
})
除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。