GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Create multiple sourcemaps from a single build · Issue #6813 · webpack/webpack

Create multiple sourcemaps from a single build #6813

New issue
Copy link
New issue
Copy link
Closed
#21001
Closed
Create multiple sourcemaps from a single build#6813
#21001
Copy link
Labels
help wantedMaintainers welcome a community PR for thisstatus: staleNo author response after a needs: request; close candidate

Description

@Xotic750
Xotic750
opened on Mar 21, 2018
Issue body actions

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

feature

What is the current behavior?

Set devtool;. NODE_ENV === PRODUCTION ? 'nosources-source-map' : 'eval-source-map';

Sourcemap type is built.

If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior?

If this is a feature request, what is motivation or use case for changing the behavior?

What we'd like is to be able to create multiple sourcemaps for production as a single run.

Set devtool: NODE_ENV === PRODUCTION ? ['nosources-source-map', 'source-map'] : 'eval-source-map';

The first sourcemap will be used client side and included in the the js e.g. //# sourceMappingURL=index.js.map

The second sourcemap would be used for our monitoring system, and would have a filename for example index.js.map2 or anything sensible.

All this would be performed in a single build run.

Perhaps this is already possible and we just haven't discovered how.

Please mention other relevant information such as the browser version, Node.js version, webpack version, and Operating System.

Activity

Next
  1. ooflorent commented on Mar 21, 2018

    @ooflorent
    ooflorent
    on Mar 21, 2018
    Contributor
    More actions

    You could use a multi-config build to achieve this:

    if (process.env.NODE_ENV === "production") {
      module.exports = [
        createConfig({name: "prod1", devtool: "nosources-source-map"}),
        createConfig({name: "prod2", devtool: "source-map"}),
      ]
    } else {
      module.exports = createConfig({name: "dev", devtool: "eval-source-map"})
    }
  2. Xotic750 commented on Mar 21, 2018

    @Xotic750
    Xotic750
    on Mar 21, 2018
    Author
    More actions

    Thanks, we have tried a multi-config. There have been concerns as to whether each config definitely creates the same final bundle (all my tests indicate that they are, but that is a limited set). Though each build does produce a different hash which is included in the sourcemap), hence a preference to have the sourcemaps created in a single run. There is also the consideration of the time that it takes to bundle our application, twice if we are using multi-config to generate the 2 types of sourcemap that we require.

    Just to add that this is for medical solutions, so there is a great deal of red-tape around what is and what isn't allowed, and the high level of concern.

    Thanks for any time and consideration.

  3. sokra commented on Mar 21, 2018

    @sokra
    sokra
    on Mar 21, 2018
    Member
    More actions

    That's possible. Just use this configuration, or similar:

    devtool: "hidden-source-map",
    plugins: [
      new SourceMapDevtoolPlugin({
        filename: "[file].secondary.map",
        noSources: true
      })
    ]
    Reacted by Florent Cailhol
  4. Xotic750 commented on Mar 21, 2018

    @Xotic750
    Xotic750
    on Mar 21, 2018
    Author
    More actions

    That's great, thanks! I will be sure to try that first thing in the morning.

  5. Xotic750 commented on Mar 22, 2018

    @Xotic750
    Xotic750
    on Mar 22, 2018
    Author
    More actions

    It looked very promising, I set

    devTool: NODE_ENV === PRODUCTION ? 'hidden-source-map' : 'eval-source-map';
    plugins: [
        new webpack.SourceMapDevToolPlugin({
          filename: '[file].map',
          noSources: true,
        }),
    ],
    output: {
        filename: FILENAME,
        path: BUILD_DIR,
        sourceMapFilename: '[file].monitor.map',
    },

    2 files were created, the index.js.map was spot on with no source in the map file and only this link was appended to the bundle. The other file index.js.monitor.map was created but the content was:

    {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourceRoot":""}

    We are using Webpack 3.11.0, the production is being uglified "uglifyjs-webpack-plugin": "^1.2.4" and transpiled "babel-core": "^6.26.0" among other things.

    Is this a bug or did I configure it incorrectly?

    I see a similar report #6133

    I created a minimum reproduction of the problem https://github.com/Xotic750/webpack-multi-sourcemap

    I also tried with Webpack 4.2.0 (though I am unable to use this in the products at present) with the same result https://github.com/Xotic750/webpack-multi-sourcemap/tree/webpack-4

  6. Xotic750 commented on Apr 3, 2018

    @Xotic750
    Xotic750
    on Apr 3, 2018
    Author
    More actions

    Is there any more information that I can provide to confirm whether this is our configuration problem or a bug? I'd like to get this working, and would even be willing to try and identify the problem in the source if needed. Thanks.

  7. alexander-akait commented on May 15, 2018

    @alexander-akait
    alexander-akait
    on May 15, 2018
    Member
    More actions

    @Xotic750 problem still exists?

  8. alexander-akait
    added
    X2: answer required
    on May 15, 2018
  9. Xotic750 commented on May 15, 2018

    @Xotic750
    Xotic750
    on May 15, 2018
    Author
    More actions

    @evilebottnawi Updated both branches linked above.
    v3.12.0 same result.
    v4.8.3 same result

  10. webpack-bot commented on Nov 13, 2018

    @webpack-bot
    webpack-bot
    on Nov 13, 2018
    Contributor
    More actions

    This issue had no activity for at least half a year.

    It's subject to automatic issue closing if there is no activity in the next 15 days.

  11. webpack-bot
    added
    status: staleNo author response after a needs: request; close candidate
    on Nov 13, 2018
  12. Xotic750 commented on Nov 14, 2018

    @Xotic750
    Xotic750
    on Nov 14, 2018
    Author
    More actions

    The problem still exists to the best of my knowledge. The test project is still available at https://github.com/Xotic750/webpack-multi-sourcemap but I have not updated it recently. If it is configuration problem on my part then I would love some guidance to show me where I've gone wrong, equally if this is a problem with webpack then I would love to see it fixed.

  13. webpack-bot
    removed
    status: staleNo author response after a needs: request; close candidate
    on Nov 14, 2018
  14. webpack-bot commented on May 15, 2019

    @webpack-bot
    webpack-bot
    on May 15, 2019
    Contributor
    More actions

    This issue had no activity for at least half a year.

    It's subject to automatic issue closing if there is no activity in the next 15 days.

  15. webpack-bot
    added
    status: staleNo author response after a needs: request; close candidate
    on May 15, 2019
  16. 73 remaining items

  17. webpack-bot
    added
    status: staleNo author response after a needs: request; close candidate
    on Jul 5, 2024
  18. webpack-bot
    closed this as completedon Jul 20, 2024
  19. alexander-akait
    reopened this on Jul 23, 2024
  20. webpack-bot
    removed
    status: staleNo author response after a needs: request; close candidate
    on Jul 23, 2024
  21. alexander-akait
    added
    enhancement
    help wantedMaintainers welcome a community PR for this
    and removed
    X2: answer required
    on Jul 23, 2024
  22. webpack-bot
    added
    status: staleNo author response after a needs: request; close candidate
    on Oct 23, 2024
  23. webpack-bot
    closed this as completedon Nov 7, 2024
  24. alexander-akait
    reopened this on Nov 7, 2024
  25. webpack-bot
    removed
    status: staleNo author response after a needs: request; close candidate
    on Nov 7, 2024
  26. webpack-bot
    added
    status: staleNo author response after a needs: request; close candidate
    on Feb 6, 2025
  27. webpack-bot
    closed this as completedon Feb 22, 2025
  28. alexander-akait
    reopened this on Feb 27, 2025
  29. alexander-akait
    closed this as completedin #21001on May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedMaintainers welcome a community PR for thisstatus: staleNo author response after a needs: request; close candidate

    Type

    No type

    Fields

    Priority

    None yet

    Projects

      • webpack 5/6
        Closed
        Status
        Priority - Low
        Show more project fields

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.