ihWarp overviewihWarp áttekintés
definitionsdefiníciókTOCTart.
Webpack plugin for copying assets referenced in HTML files. This plugin scans through Webpack's output assets for HTML files, extracts asset references (from src, href, meta tags, etc.), and copies the referenced asset files from specified directories (assetPaths) into the Webpack output directory. Files can be excluded from processing via exceptHTML (for HTML files) and exceptAssets (for asset paths). Additionally, if the asset file's extension is listed in mapExtensions, a corresponding .map file will also be copied.
Webpack plugin a HTML-fájlokban hivatkozott erőforrások (assetek) másolásához. A plugin átvizsgálja a Webpack kimeneti assetjei között található HTML-fájlokat, kinyeri belőlük az erőforrás-hivatkozásokat (a src és href attribútumokból, a meta címkékből stb.), majd a hivatkozott fájlokat a megadott könyvtárakból (assetPaths) átmásolja a Webpack kimeneti könyvtárába. Bizonyos fájlok kizárhatók a feldolgozásból az exceptHTML (HTML-fájlok esetén) és az exceptAssets (asset-elérési utak esetén) beállítással. Ezenkívül, ha az asset fájl kiterjesztése szerepel a mapExtensions listában, a hozzá tartozó .map fájlt is átmásolja.
requirementskövetelmények
- Node.js LTS (version >=20.17.0 <21 || >=22 <23 || >=24 <25 || >=26 <27)
- Node.js LTS (verzió: >=20.17.0 <21 || >=22 <23 || >=24 <25 || >=26 <27)
- npm version >=10.8.2
- npm verzió >=10.8.2
- Webpack >= 5 (compatible with Webpack 4)
- Webpack >= 5 (kompatibilis Webpack 4-gyel is)
installationtelepítés
Installation (npm):Telepítés (npm):
npm install --save-dev @inebhedj/ih-warpusagehasználat
Webpack configuration (example):Webpack konfiguráció (példa):
const ihWARP = require('@inebhedj/ih-warp');/* other codes */module.exports = { /* webpack configuration settings... */ plugins: [ /* other plugins... */ new ihWARP({ assetPaths: ['./src/assets'], exceptHTML: ['ignore-this.html'], exceptAssets: ['ignore-this.png'], mapExtensions: ['.css', '.js'], verbose: true }) /* other plugins... */ ] /* other configuration settings... */};ihWarp configurationihWarp beállítások
optionsopciókTOCTart.
Configuration options available for the ihWARP plugin.
Az ihWARP bővítmény elérhető konfigurációs beállításai.
| optionopció | typetípus | defaultalapérték | descriptionleírás |
|---|---|---|---|
assetPaths | string | string[] | [] | Array of directory/directories where the asset files are searched.Könyvtár(ak) tömbje, ahol az asset fájlokat keresi a plugin. |
exceptHTML | string[] | [] | Array of HTML file paths (relative to output) to be excluded from processing.A feldolgozásból kizárandó HTML-fájlok relativ elérési útjainak tömbje (a kimeneti könyvtárhoz viszonyítva). |
exceptAssets | string[] | [] | Array of asset paths or filenames to be omitted from processing.A feldolgozásból kihagyandó asset-elérési utak vagy fájlnevek tömbje. |
mapExtensions | string[] | ['.css', '.js'] | Array of file extensions for which associated .map files are copied.Azon fájlkiterjesztések tömbje, amelyekhez tartozó .map fájlok is átmásolásra kerülnek. |
verbose | boolean | true | Enables detailed logging output in the console during the Webpack build.Részletes naplózást engedélyez a konzolon a Webpack build során. |