Exclude vendor files from source map
See original GitHub issueIs it possible to exclude certain files from running through sourcemaps? I.E. I have vendor/some-lib.js
and while I want that file included in the build, I don’t want it included in the sourcemap.
Here is my webpack.config.js
.
'use strict';
const pkg = require('./package');
const path = require('path');
const webpack = require('webpack');
module.exports = {
devtool: 'source-map',
entry: path.join(__dirname, 'src', 'lib.js'),
target: 'web',
output: {
path: path.join(__dirname, 'dist'),
filename: 'charge-xvs.js'
},
plugins: [
new webpack.BannerPlugin('charge-xvs.js | ' + pkg.version, {
entryOnly: true
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
mangle: true
}),
new webpack.optimize.DedupePlugin()
]
};
Issue Analytics
- State:
- Created 7 years ago
- Reactions:13
- Comments:40 (4 by maintainers)
Top Results From Across the Web
webpack 5 source maps vendor naming/exclusion
giving an explicit name for the split chunks, it was easy to exclude them splitChunks: { chunks: "all", cacheGroups: { defaultVendors: ...
Read more >SourceMapDevToolPlugin - webpack
The following code would exclude source maps for any modules in the vendor.js bundle: new webpack.SourceMapDevToolPlugin({ filename: '[file].map[query]', ...
Read more >SourceMapDevToolPlugin - webpack 3 documentation
This plugin enables more fine grained control of source map generation. It is an alternative to the devtool configuration option. new webpack.
Read more >Can't collect static files if don't have vendor's JavaScript ...
If one is using 3rd party JavaScript library, its often a minified Javascript file, that quite likely it has a source map url...
Read more >TSConfig Reference - Docs on every TSConfig option
A TSConfig file in a directory indicates that the directory is the root of a ... Generates a source map for .d.ts files...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@nodesocket @sokra Any update on this?
@sky-coding Yeah, using SourceMapDevToolPlugin instead of devtool option.