O
O
Oleg Drapeza2016-11-16 12:05:25
webpack
Oleg Drapeza, 2016-11-16 12:05:25

How to prevent minification of a separate part of html or javascript code?

Good afternoon!
Faced the following problem: It is
necessary to display the js code on the page and highlight it using the prismjs library.
The template of this code is stored in the html file, in the application itself I call it through require('./script.tpl.html').
The problem is that during production build, webpack minifies this html template, resulting in one long line.
Is it possible to protect a part of the code from minification? For example special comments in js or in html for UglifyJsPlugin?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question