From ee9b6b2b4fd581d32edeba620f9d6a54ba14dabd Mon Sep 17 00:00:00 2001 From: Simon Ihmig Date: Mon, 4 Dec 2023 19:02:12 +0100 Subject: [PATCH] Hide base path from public URL of rollup-public-assets This change is to enable a v2 addon to expose its public assets under the same URL as a v1 addon would. But currently, the public URL would always include the base path that you pass into the rollup plugin. Say if your v1 addon `my-addon` had `public/foo/bar.jpg`, it would expose taht under the URL of `/my-addon/foo/bar.jpg`. But if converting that to v2 and putting the file into e.g. `src/public/foo/bar.jpg`, then using the rollup plugin it would be exposed as `/my-addon/src/public/foo/bar.jpg`, and no way to get rid off the path (`src/public`). This change is removing that, which makes this a breaking one. --- packages/addon-dev/src/rollup-public-assets.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/addon-dev/src/rollup-public-assets.ts b/packages/addon-dev/src/rollup-public-assets.ts index 80147ead8..b11428b5a 100644 --- a/packages/addon-dev/src/rollup-public-assets.ts +++ b/packages/addon-dev/src/rollup-public-assets.ts @@ -20,7 +20,7 @@ export default function publicAssets( }); const publicAssets: Record = filenames.reduce( (acc: Record, v): Record => { - acc[`./${path}/${v}`] = ['/', pkg.name, '/', path, '/', v].join(''); + acc[`./${path}/${v}`] = ['/', pkg.name, '/', v].join(''); return acc; }, {}