There was an error while loading. Please reload this page.
1 parent f2cc506 commit 69924a1Copy full SHA for 69924a1
src/plugin/plugin.js
@@ -12,12 +12,15 @@ export default class VisualizerPlugin {
12
apply(compiler) {
13
compiler.plugin('emit', (compilation, callback) => {
14
let stats = compilation.getStats().toJson({chunkModules: true});
15
+ let stringifiedStats = JSON.stringify(stats);
16
+ stringifiedStats = stringifiedStats.replace(/</g, '<').replace(/</g, '>');
17
+
18
let html = `<!doctype html>
19
<meta charset="UTF-8">
20
<title>Webpack Visualizer</title>
21
<style>${cssString}</style>
22
<div id="App"></div>
- <script>window.stats = ${JSON.stringify(stats)};</script>
23
+ <script>window.stats = ${stringifiedStats};</script>
24
<script>${jsString}</script>
25
`;
26
0 commit comments