1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-12-15 15:18:27 +09:00
misskey/webpack/module/rules/collapse-spaces.ts
2018-02-15 23:07:23 +09:00

20 lines
415 B
TypeScript

import * as fs from 'fs';
const minify = require('html-minifier').minify;
export default () => ({
enforce: 'pre',
test: /\.vue$/,
exclude: /node_modules/,
loader: 'string-replace-loader',
query: {
search: /^<template>([\s\S]+?)\r?\n<\/template>/,
replace: html => {
return minify(html, {
collapseWhitespace: true,
collapseInlineTagWhitespace: true,
keepClosingSlash: true
});
}
}
});