source-map-loader
extracts inlined source map and offers it to webpack
Last updated 2 months ago by evilebottnawi .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install source-map-loader 
SYNC missed versions from official npm registry.

npm node deps tests coverage chat size

source-map-loader

Extracts source maps from existing source files (from their sourceMappingURL).

Getting Started

To begin, you'll need to install source-map-loader:

npm i -D source-map-loader

Then add the plugin to your webpack config. For example:

file.js

import css from 'file.css';

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.js$/,
        enforce: 'pre',
        use: ['source-map-loader'],
      },
    ],
  },
};

source-map-loader extracts existing source maps from all JavaScript entries. This includes both inline source maps as well as those linked via URL. All source map data is passed to webpack for processing as per a chosen source map style specified by the devtool option in webpack.config.js. This loader is especially useful when using 3rd-party libraries having their own source maps. If not extracted and processed into the source map of the webpack bundle, browsers may misinterpret source map data. source-map-loader allows webpack to maintain source map data continuity across libraries so ease of debugging is preserved. source-map-loader will extract from any JavaScript file, including those in the node_modules directory. Be mindful in setting include and exclude rule conditions to maximize bundling performance.

And run webpack via your preferred method.

Examples

Ignoring Warnings

To ignore warnings, you can use the following configuration:

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.js$/,
        enforce: 'pre',
        use: ['source-map-loader'],
      },
    ],
  },
  stats: {
    warningsFilter: [/Failed to parse source map/],
  },
};

More information about the warningsFilters option you can find here;

Contributing

Please take a moment to read our contributing guidelines if you haven't yet done so.

CONTRIBUTING

License

MIT

Current Tags

  • 1.0.0                                ...           latest (2 months ago)

13 Versions

  • 1.0.0                                ...           2 months ago
  • 0.2.4                                ...           2 years ago
  • 0.2.3                                ...           3 years ago
  • 0.2.2                                ...           3 years ago
  • 0.2.1                                ...           3 years ago
  • 0.2.0                                ...           3 years ago
  • 0.1.6                                ...           4 years ago
  • 0.1.5                                ...           5 years ago
  • 0.1.4                                ...           5 years ago
  • 0.1.3                                ...           6 years ago
  • 0.1.2                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
Downloads
Today 93
This Week 3,602
This Month 20,462
Last Day 1,820
Last Week 10,380
Last Month 42,405
Dependencies (5)
Dev Dependencies (22)
Dependents (965)

Copyright 2014 - 2017 © taobao.org |