diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-02-15 23:07:19 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-02-15 23:07:23 +0900 |
| commit | a7601f7aa493db5d96b66fbbf79e92ff54c4ff28 (patch) | |
| tree | d9be1db31dea154ca3e9141277f63f77d630be5f /webpack/module/rules/collapse-spaces.ts | |
| parent | wip (diff) | |
| download | sharkey-a7601f7aa493db5d96b66fbbf79e92ff54c4ff28.tar.gz sharkey-a7601f7aa493db5d96b66fbbf79e92ff54c4ff28.tar.bz2 sharkey-a7601f7aa493db5d96b66fbbf79e92ff54c4ff28.zip | |
wip
Diffstat (limited to 'webpack/module/rules/collapse-spaces.ts')
| -rw-r--r-- | webpack/module/rules/collapse-spaces.ts | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/webpack/module/rules/collapse-spaces.ts b/webpack/module/rules/collapse-spaces.ts index 48fd57f017..734c735926 100644 --- a/webpack/module/rules/collapse-spaces.ts +++ b/webpack/module/rules/collapse-spaces.ts @@ -1,20 +1,19 @@ 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: /^<template>([\s\S]+?)\r?\n<\/template>/, replacement: html => { - return minify(html, { - collapseWhitespace: true, - collapseInlineTagWhitespace: true, - keepClosingSlash: true - }); - } - }] - }) + loader: 'string-replace-loader', + query: { + search: /^<template>([\s\S]+?)\r?\n<\/template>/, + replace: html => { + return minify(html, { + collapseWhitespace: true, + collapseInlineTagWhitespace: true, + keepClosingSlash: true + }); + } + } }); |