Reputation: 569
I am using webpack --optimize-minimize
and I notice that the compiled file still has comments with the filename. How do I tell Webpack.optimize.UglifyJsPlugin
to remove these as well?
Here is the generated file see how the end of the first line starts a comment and it continues to line 3. This is what I want to remove
!function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([/*!*************************!*\
!*** ./src/js/index.js ***!
\*************************/
function(e,t){"use strict";function r(e){return e}Object.defineProperty(t,"__esModule",{value:!0}),t.identity=r}]);%
Upvotes: 1
Views: 2456
Reputation: 569
That comment is called the pathinfo
and is generated by the output.pathinfo
property. This can be disabled by removing that option or setting it to false from the webpack config. See the docs for more details.
output: {
pathinfo: false
},
Upvotes: 1