question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Preact build not copying over manifest.json and assets

See original GitHub issue

Do you want to request a feature or report a bug? Bug

What is the current behaviour? When using preact build --no-prerender, the manifest.json and assets/* files get replaced with the default template ones.

If the current behaviour is a bug, please provide the steps to reproduce. I’m using the typescript template. I only added an additional build flag in the package.json file.

What is the expected behaviour? I’m assumed my manifest.json file would be copied over.

Please mention other relevant information. I’m using the latest Preact X.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
LorenzoZaccagninicommented, Jan 4, 2020

This is my temporary fix in package.json

"scripts": {
    "start": "if-env NODE_ENV=production && npm run -s serve || npm run -s dev",
    "build": "preact build --template src/template.html && npm run copy_manifest",
    "copy_manifest": "cp manifest.json build/manifest.json && cp assets/icon.png build/assets/icon.png",
    "serve": "preact build && preact serve",
    "dev": "preact watch --template src/template.html",
    "lint": "eslint src"
  },

Basically I copy manifest.json and the icon into the build folder

1reaction
cjoycommented, Nov 1, 2019

@prateekbh I can see the original manifest.json file (the one that was there when the project was generated).

I’m using 3.0.0-next.19

Read more comments on GitHub >

github_iconTop Results From Across the Web

Preact Chrome extention Manifest warning regarding icons type
Setting up a Preact Chrome extension and getting a warning of Manifest: property 'icons' ignored, type array expected.
Read more >
preact-cli | Yarn - Package Manager
- No longer copies 'sw-debug.js' to output directory on prod builds. No functional changes, as it was not used. ... ab84275 #1434 Thanks...
Read more >
vite - npm
The vue , react and preact templates of create-vite-app all come with HMR out of the box. ... production build. Never-referenced assets will...
Read more >
API - esbuild
The build API call operates on one or more files in the file system. ... so on) will also be inlined. By default...
Read more >
How to Create a PWA Game Using Preact in 5 Steps · Tutorial
manifest.json. ├── routes. └── style. assets will contain our assets (favicon and other icons); components will have our preact ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found