amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Rewrite amp-story-player CDN hosted script to the local build

Open Enriqe opened this issue 5 years ago • 2 comments

Currently, importing a script with the CDN URL (https://cdn.ampproject.org/...) in a local sample will be rewritten by the build system so you get the local build of the library. This is not the case for the non-AMP version of the amp-story-player.

Steps to repro:

  1. Open a local sample with the amp-story-player and import it using the <script async src="https://cdn.ampproject.org/amp-story-player-v0.js"></script>

Expected: Getting the local build. Actual: Getting the CDN hosted build.

More context

Today, we need to specifically write <script async src="../../dist/amp-story-player.js"></script>, which is unlike other extensions and brings confusion in local development.

The non-AMP version of the player is located in src/, specifically here: https://github.com/ampproject/amphtml/blob/master/src/amp-story-player/amp-story-player.js

And here is where we define the minified name and location: https://github.com/ampproject/amphtml/blob/1e565fb911c045fba5a6e1fb9555b75f6c880529/build-system/compile/bundles.config.js#L158-L167

Is there something else we need to make it work? @ampproject/wg-infra @ampproject/wg-stories

Enriqe avatar Oct 22 '20 15:10 Enriqe

cc @ampproject/wg-infra @rsimha do you know what we're missing here and why the CDN URL isn't rewritten to the local build one for this extension?

gmajoulet avatar Feb 25 '21 21:02 gmajoulet

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 01 '22 06:10 stale[bot]