From febf821f87dee1d37e2481a93a5c5d5b3e4a6005 Mon Sep 17 00:00:00 2001 From: Kushagra Gour Date: Sat, 16 Jun 2018 15:25:26 +0530 Subject: [PATCH] remove html minification --- package.json | 2 +- preact.config.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 851ecde..726476a 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "A blazing fast & offline web playground", "scripts": { "start": "if-env NODE_ENV=production && npm run -s serve || npm run -s dev", - "build": "preact build", + "build": "preact build --template src/index.html --no-prerender", "serve": "preact build && preact serve", "dev": "preact watch --template src/index.html --https --no-prerender", "lint": "eslint src", diff --git a/preact.config.js b/preact.config.js index 9dcd9ad..ff2dca9 100644 --- a/preact.config.js +++ b/preact.config.js @@ -13,6 +13,12 @@ export default function (config, env, helpers) { if (env.isProd) { config.devtool = false; // disable sourcemaps + const htmlWebpackPlugin = helpers.getPluginsByName(config, 'HtmlWebpackPlugin')[0]; + Object.assign(htmlWebpackPlugin.plugin.options.minify, { + removeComments: false, + collapseWhitespace: false + }) + config.plugins.push( new CommonsChunkPlugin({ name: 'vendor',