Giter Club home page Giter Club logo

Comments (9)

lukeed avatar lukeed commented on May 22, 2024 2

You can also access webpack's root, although I can't remember what it's called now.

from preact-cli.

developit avatar developit commented on May 22, 2024 1

Ah yeah. I think something needs to tell the sw plugin what webpacks context directory was.

from preact-cli.

stevenfitzpatrick avatar stevenfitzpatrick commented on May 22, 2024 1

I remember using "stripPrefixMulti" in sw-precache plugin to fix this

new SWPrecacheWebpackPlugin({
    cacheId: pkg.name,
    filename: 'sw.js',
    minify: true,
    maximumFileSizeToCacheInBytes: 4194304,
    stripPrefixMulti: {
      'C:/dev/site/dist': '',
      '/home/travis/build/myname/site/dist': ''
    }
  }),

from preact-cli.

developit avatar developit commented on May 22, 2024 1

I think we can even just pass it process.cwd()

from preact-cli.

developit avatar developit commented on May 22, 2024 1

yup yup. just figured we'd keep this bit generic since there might be a time when we want to support an "eject" feature.

from preact-cli.

jordaofranca avatar jordaofranca commented on May 22, 2024

Can we change it to this?

new SWPrecacheWebpackPlugin({
	filename: 'sw.js',
	navigateFallback: 'index.html',
	minify: true,
	staticFileGlobsIgnorePatterns: [
		/\.map$/,
		/push-manifest\.json$/
	],
	stripPrefixMulti: {
		 [process.cwd()]: ''
	 }
})

from preact-cli.

NekR avatar NekR commented on May 22, 2024

Oh, if there only was a plugin which can do all that automatically. It would be such a bless 😎 πŸ˜‚

from preact-cli.

developit avatar developit commented on May 22, 2024

I believe this was fixed in 1.1.1?

from preact-cli.

rkostrzewski avatar rkostrzewski commented on May 22, 2024

Indeed it was, absolute paths are no longer there. Closing.

from preact-cli.

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.