ashutoshsce / minify-html-webpack-plugin Goto Github PK
View Code? Open in Web Editor NEWA webpack plugin to minify html file(s) after building
License: MIT License
A webpack plugin to minify html file(s) after building
License: MIT License
Is it possible to search and replace a string in all .HTML files? For example, I have a string "CACHE_KEY" that I want to find every instance of in all HTML files and have it replaced with a hash. It seems to search and replace will find the first instance, then stop. I was hoping it can search the entire dist
direct and replace all.
Is there a way to call this plugin at the end of build?
I'm using laravel-mix with laravel-mix-nunjucks plugin to compile nunjucks files into html, so the files don't exist yet. Maybe it's not even this plugin-related question.
If the source directory contains a folder inside apart from the expected html files, the script results in an error since it is expecting to read a file.
Potential Fixes:
After running the script, I found that it performs minification on the original source HTML file itself by default. Usually this behaviour is not expected and can cause damage in case the source file is not protected using a version control.
Potential Fixes (in the descending order of preference):
output>path
directory and pass it to the script.dest
is not provided in the options.dest
is needed and provide a warning that original source code will be overwritten if dest
is missing from the options.When running the wepack
command to perform a build, it throws an error:
ReferenceError: path is not defined
at C:\Users\Rishab Manocha\Source code\agency-website\node_modules\minify-html-webpack-plugin\index.js:24:28
Looking in the index.js file, it looks like the you forgot to add
const path = require('path');
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.