Giter VIP home page Giter VIP logo

Comments (6)

tiptronic avatar tiptronic commented on August 17, 2024 1

hi luke,
thx for the great feedback... After deleting my project folder, I understood we're talking about 2 different things 😊 (sorry about me being unclear 🙄 )
I will check out your hints asap (not today, as it's pretty late here)...
Maybe you want to add some of these hints to your readme. Or - even better IMO - put a 'pwa.config.js' file into the repo, so people (like me) get a hint, there are options....
Anyway - I appreciate your responsiveness pretty much and I'm looking forward how things work out...
Thx again!!

from pwa.

lukeed avatar lukeed commented on August 17, 2024

You should be able to just do --dest <target> on either your build or export commands.

$ pwa export --dest foobar

# => foobar/index.html
# => foobar/about/index.html
# => etc

from pwa.

tiptronic avatar tiptronic commented on August 17, 2024

Did you try?
I tried
$ pwa export --dest .
and it deleted the whole project 😱

from pwa.

tiptronic avatar tiptronic commented on August 17, 2024

Also: the paths generated are not relative.... they always point to the absolute path (starting with a '/')
<link rel="shortcut icon" href="/assets/favicon.png" /> <link rel="manifest" href="/assets/manifest.json" /> <link href="/bundle.7c264.css" rel="stylesheet" />

from pwa.

lukeed avatar lukeed commented on August 17, 2024

Ah, I misunderstood you – sorry. The --dest flag changes where the build files are placed. It also clears the existing/previous files to ensure it's a clean build. I hope you were able to recover your files!

As for relative pathing, that's controlled by webpack's output.publicPath config. It is / by default (in both PWA and webpack).

To change it, you do this:

// pwa.config.js
exports.webpack = function (config) {
  config.output.publicPath = './'; // or whatever you want
}

That will update all the webpack-controlled asset pathing.

In the snippet you pasted above, that means that (only) /bundle.7c264.css will become ./bundle.7c264.css.

To change the /assets/favicon.png and /assets/manifest.json you have to manually change those in your src/index.html – which PWA scaffolded for you during init phase.


I've tested the above config & made the changes to src/index.html's meta tags. All works as you've requested.

You do not need the --dest flag – sorry for misunderstanding the question initially.

Hope that helps!

from pwa.

lukeed avatar lukeed commented on August 17, 2024

I think it was mostly my fault, not to worry!

I'm trying to set aside some time to do another sprint of PWA changes. It hasn't been super high on my list lately, simply because it works reliably for my needs now. ...But I definitely need to make sure the documentation is up to par & that the tools that others use are supported.

from pwa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.