0

I am using the following snippets while building my react based application with webpack. I need to restrict the max line length of the output file to 7000 characters and the below config helps do it except if there is a CSS line in the bundle. The CSS line comes in a string literal and it goes beyond this restriction. How do I make the restriction applied to CSS embedded within the bundle?

new Webpack.optimize.UglifyJsPlugin({
  compress: {
    warnings: false
  },
  output: {
    comments: false,
    max_line_len: 7000
  },
  sourceMap: false
})

A task which is used during the build from npm -

UglifyJS.minify([ ... ], {
                                                            output: {                
                                                                max_line_len: 7000
                                                              }
                                                        });
  • Why are you mixing CSS with JavaScript in the first place? – J. Titus May 17 '17 at 18:58
  • This was an existing project so haven't given a thought of changing any build config. The pain point was that the CI system crashes on files which have more than 7000 characters. Thanks for pointing out. Whats the easiest way to pull out the CSS and have a restriction put on that? – Nitin Pai May 20 '17 at 17:53

0 Answers0