Git Product home page Git Product logo

Comments (4)

shama avatar shama commented on July 22, 2024

Isn't that handled by the webpack option devtool? https://webpack.js.org/configuration/devtool/

I'm not sure why this library would need to do extra handling of source maps.

from webpack-stream.

marekdedic avatar marekdedic commented on July 22, 2024

Hmm, maybe I didn't explain myself clearly - I'm talking about the need to do

.pipe(through.obj(function (file, enc, cb) {
      // Dont pipe through any source map files as it will be handled
      // by gulp-sourcemaps
      const isSourceMap = /\.map$/.test(file.path);
      if (!isSourceMap) this.push(file);
      cb();
}))

Webpack doesn't catre about streams - it just spits out the sourcemap. However, afaik, in gulp-sourcemaps, the sourcemap isn't actually a separate file, so the extra file needs to be removed by the code above.

from webpack-stream.

shama avatar shama commented on July 22, 2024

This library doesn't do anything with source maps though so I'm not sure why it would need to have this special circumstance. I think you could just configure webpack to output or not output the desired source maps or just keep doing that code above. I think that use case is outside the scope of this library.

from webpack-stream.

marekdedic avatar marekdedic commented on July 22, 2024

Hi, I think the use case is in scope - ultimately, the decision is of course yours, but I will try to change your mind by laying out my thought process:

I do want to produce sourcemaps. I'm using webpack-stream, a library that adapts webpack to a streaming interface (my understanding of its purpose, correct me if I'm wrong). From what I can gather, the standard way of handling source maps in gulp/streams is with the file.sourceMap property on the stream. I am trying to argue that webpack-stream should therefore adapt the webpack output to this format by default (althought changing the default now would be problematic, so let's not do that). As far as I understand this, that is not currently the case - I can either inline the sourcemap into the file itself by setting devtool: "inline-source-map" or have it as a separate file altogether.

from webpack-stream.

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.