html-minifier-next 5.1.6 → 5.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/cli.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ Use `html-minifier-next --help` to check all available options:
|
|
|
38
38
|
| `--ignore-dir <patterns>`, `-X <patterns>` | Exclude directories—relative to input directory—from processing (comma-separated, overrides config file setting) | `--ignore-dir=libs`, `--ignore-dir=libs,vendor,node_modules` |
|
|
39
39
|
| `--output-dir <dir>`, `-O <dir>` | Specify an output directory | `--output-dir=dist` |
|
|
40
40
|
| `--output <file>`, `-o <file>` | Specify output file (reads from file arguments or STDIN) | File to file: `html-minifier-next input.html -o output.html`<br>Pipe to file: `cat input.html \| html-minifier-next -o output.html`<br>File to STDOUT: `html-minifier-next input.html` |
|
|
41
|
-
| `--file-ext <extensions>`, `-f <extensions>` | Specify file extension(s) to process (comma-separated, overrides config file setting); defaults to `html,htm,
|
|
41
|
+
| `--file-ext <extensions>`, `-f <extensions>` | Specify file extension(s) to process (comma-separated, overrides config file setting); defaults to `html,htm,shtml,shtm`; use `*` for all files | `--file-ext=html,php`, `--file-ext='*'` |
|
|
42
42
|
| `--preset <name>`, `-p <name>` | Use a preset configuration (conservative or comprehensive) | `--preset=conservative` |
|
|
43
43
|
| `--config-file <file>`, `-c <file>` | Use a configuration file | `--config-file=html-minifier.json` |
|
|
44
44
|
| `--verbose`, `-v` | Show detailed processing information (active options, file statistics) | `html-minifier-next --input-dir=src --output-dir=dist --verbose --collapse-whitespace` |
|
|
@@ -400,7 +400,7 @@ npx html-minifier-next --input-dir=test --preset comprehensive --output-dir exam
|
|
|
400
400
|
**Process specific files and directories:**
|
|
401
401
|
|
|
402
402
|
```shell
|
|
403
|
-
# Process default extensions (html, htm,
|
|
403
|
+
# Process default extensions (html, htm, shtml, shtm)
|
|
404
404
|
html-minifier-next --collapse-whitespace --input-dir=src --output-dir=dist
|
|
405
405
|
|
|
406
406
|
# Process only specific extensions
|
package/cli.js
CHANGED
|
@@ -47,7 +47,7 @@ import { optionDefinitions } from './src/lib/option-definitions.js';
|
|
|
47
47
|
const require = createRequire(import.meta.url);
|
|
48
48
|
const pkg = require('./package.json');
|
|
49
49
|
|
|
50
|
-
const DEFAULT_FILE_EXTENSIONS = ['html', 'htm', '
|
|
50
|
+
const DEFAULT_FILE_EXTENSIONS = ['html', 'htm', 'shtml', 'shtm'];
|
|
51
51
|
|
|
52
52
|
const program = new Command();
|
|
53
53
|
program.name(pkg.name);
|
|
@@ -240,7 +240,7 @@ let config = {};
|
|
|
240
240
|
program.option('-I --input-dir <dir>', 'Specify an input directory');
|
|
241
241
|
program.option('-X --ignore-dir <patterns>', 'Exclude directories—relative to input directory—from processing (comma-separated), e.g., “libs” or “libs,vendor,node_modules”');
|
|
242
242
|
program.option('-O --output-dir <dir>', 'Specify an output directory');
|
|
243
|
-
program.option('-f --file-ext <extensions>', 'Specify file extension(s) to process (comma-separated); defaults to “html,htm,
|
|
243
|
+
program.option('-f --file-ext <extensions>', 'Specify file extension(s) to process (comma-separated); defaults to “html,htm,shtml,shtm”; use “*” for all files');
|
|
244
244
|
program.option('-p --preset <name>', `Use a preset configuration (${getPresetNames().join(', ')})`);
|
|
245
245
|
program.option('-c --config-file <file>', 'Use config file');
|
|
246
246
|
program.option('--cache-css <size>', 'Set CSS minification cache size (number of entries, default: 500)', parseValidInt('cacheCSS'));
|
|
@@ -266,7 +266,7 @@ program.helpOption('-h, --help', 'Display help for command');
|
|
|
266
266
|
const jsonOptionKeys = ['minifyCss', 'minifyJs', 'minifyUrls'];
|
|
267
267
|
for (const key of jsonOptionKeys) {
|
|
268
268
|
const value = programOptions[key];
|
|
269
|
-
if (typeof value === 'string' && /\.(html?|php|xml|svg|
|
|
269
|
+
if (typeof value === 'string' && /\.(html?|shtml?|xhtml?|php|xml|svg|jsx|tsx|vue|ejs|hbs|mustache|twig)$/i.test(value)) {
|
|
270
270
|
// The option consumed a filename - inject it back
|
|
271
271
|
programOptions[key] = true;
|
|
272
272
|
capturedFiles.push(value);
|
package/package.json
CHANGED