Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static does not work with fingerprinting #536

Open
mokkabonna opened this issue Nov 23, 2022 · 2 comments
Open

Static does not work with fingerprinting #536

mokkabonna opened this issue Nov 23, 2022 · 2 comments

Comments

@mokkabonna
Copy link

mokkabonna commented Nov 23, 2022

Steps to reproduce
Steps to reproduce the behavior:

  1. Setup static with fingerprinting
@static
fingerprint true
  1. Use static helper to get fingerprinted path of asset
  2. deploy

Expected behavior
Expect the static helper to get the fingerprinted path. It does not. it only get the non fingerprinted path.

Seems this is the problem:
Why does the code look here(node_modules folder) https://github.com/architect/functions/blob/main/src/static/index.js#L18 for the manifest? While the file is written to /public/static.json? https://github.com/architect/deploy/blob/main/src/static/publish/write-static-manifest.js#L11

@architect/functions 5.2.3
@architect/architect 10.7.1

@beckelmw
Copy link

beckelmw commented Jun 1, 2023

I ended up working around this with a custom plugin which copies the file where it needs to be during hydrate.

module.exports = {
  hydrate: {
    copy: async ({ arc, inventory, copy }) => {
      await copy({
        source: "./public/static.json",
        target:
          "@architect/shared/static.json",
      });
    },
  },
};

@Xiphe
Copy link

Xiphe commented Jun 19, 2023

I was also encountering this issue together with the typescript plugin. I suspect the problem is that with typescript esbuild bundles the whole function but the static sill tries to look up the static.json on the file system

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants