GithubHelp home page GithubHelp logo

Comments (3)

code-later avatar code-later commented on July 23, 2024 1

Thanks @FND for the feedback and even more the guidance. I'll give it a try and have a look on how to add this to faucet-pipeline.

from faucet-pipeline-js.

FND avatar FND commented on July 23, 2024

Hey Dirk, thanks for providing some context here.

I assume your concern is primarily about JavaScript source maps? Since I don't use (am philosophically opposed to 👴 ) source maps myself, I never fully grokked how our implementation actually works in detail. So I'm not really sure what needs to be done to support stand-alone source maps, but I can (grudgingly 😉 ) try to provide some guidance for anyone interested in implementing this:

Support for source maps was introduced in 61f8576, and it looks like Rollup supports what you want. So I'm guessing it should be possible to extend our implementation by massaging faucet's sourcemaps option - perhaps similar to the way compacting works: cce6245 (--sourcemaps to activate, optional sourcemaps configuration in bundle configuration for customization). HTH.

from faucet-pipeline-js.

FND avatar FND commented on July 23, 2024

FWIW, having encountered externalized source maps elsewhere recently, I've realized that it might be simpler than I'd expected: The actual source map's JSON data remains identical AFAICT, the respective file is referenced as //# sourceMappingURL=bundle.js.map from within the bundle - so we'd just need to write the same data to a separate file (${bundle.filepath}.map) and replace the Base64-encoded data URI with this reference.

Having said that, this might require a little bit of re-architecting:

code: map ? `${code}\n${SMPREFIX}${map.toUrl()}\n` : code,

The generateBundle function there (intentionally) doesn't have access to assetManager.writeFile, so we'd probably wanna extend the return value to { code, map, … } to eventually (via BasicBundle and Bundle - yes, this is a little convoluted, because reasons) write a source-map file alongside the actual bundle:
return ({ code, error }) => {

from faucet-pipeline-js.

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.