Browse Source

docs(create): Add inline documentation on assetUrlPrefix

Fixes #1776
Michael Bromley 3 years ago
parent
commit
ffe48db369
1 changed files with 4 additions and 0 deletions
  1. 4 0
      packages/create/templates/vendure-config.hbs

+ 4 - 0
packages/create/templates/vendure-config.hbs

@@ -73,6 +73,10 @@ export const config: VendureConfig = {
         AssetServerPlugin.init({
             route: 'assets',
             assetUploadDir: path.join(__dirname, '../static/assets'),
+            // For local dev, the correct value for assetUrlPrefix should
+            // be guessed correctly, but for production it will usually need
+            // to be set manually to match your production url.
+            assetUrlPrefix: IS_DEV ? undefined : 'https://www.my-shop.com/assets',
         }),
         DefaultJobQueuePlugin.init({ useDatabaseForBuffer: true }),
         DefaultSearchPlugin.init({ bufferUpdates: false, indexStockStatus: true }),