mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-10-31 13:34:12 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
	
		
			415 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			19 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
 | |
| 			});
 | |
| 		}
 | |
| 	}
 | |
| });
 |