diff --git a/package.json b/package.json index fee512c7ff..906d512dc1 100644 --- a/package.json +++ b/package.json @@ -118,6 +118,7 @@ "gulp-uglify": "3.0.0", "gulp-util": "3.0.8", "highlight.js": "9.12.0", + "html-minifier": "^3.5.9", "inquirer": "5.0.1", "is-root": "1.0.0", "is-url": "1.2.2", diff --git a/webpack/module/rules/base64.ts b/webpack/module/rules/base64.ts index 529816bd20..6d7eaddeba 100644 --- a/webpack/module/rules/base64.ts +++ b/webpack/module/rules/base64.ts @@ -7,7 +7,7 @@ const StringReplacePlugin = require('string-replace-webpack-plugin'); export default () => ({ enforce: 'pre', - test: /\.(tag|js)$/, + test: /\.(vue|js)$/, exclude: /node_modules/, loader: StringReplacePlugin.replace({ replacements: [{ diff --git a/webpack/module/rules/collapse-spaces.ts b/webpack/module/rules/collapse-spaces.ts new file mode 100644 index 0000000000..48fd57f017 --- /dev/null +++ b/webpack/module/rules/collapse-spaces.ts @@ -0,0 +1,20 @@ +import * as fs from 'fs'; +const minify = require('html-minifier').minify; +const StringReplacePlugin = require('string-replace-webpack-plugin'); + +export default () => ({ + enforce: 'pre', + test: /\.vue$/, + exclude: /node_modules/, + loader: StringReplacePlugin.replace({ + replacements: [{ + pattern: /^