A cli tool that reads HTML files and updates their script, style or import 'src' or 'href' according to your settings.
โ
Polymer projects that change the location of their 3rd party libs
โ
Polymer projects that move to npm
โ
Any project that has a bunch of HTML imports that need to be bulk-updated
โ
Works with nested HTML imports and can exclude paths
Download the latest binary release for your OS on the release page.
Available builds: linux, macos, windows
To package the app yourself (essentially create the binaries mentioned above), run
npm run publish:all # creates binaries in ./package
You can run this tool as a node app or packaged executable.
yarn add html-import-updater # or npm install html-import-updater
cd node_modules/html-import-updater
node ./index.js [options]
# or clone repo and run
node ./index.js [options]
PowerShell ./html-import-updater.exe [options]
./html-import-updater [options]
Usage: index [options]
Options:
-V, --version output the version number
--cwd, --workingDir Current working directory (where your files
are).
--e, --excludePaths One or many paths (or globs) you want to
exclude, i.e. `-e "prefix-*"`. Can be
applied multiple times: `-e "one" -e "two"`.
--o, --outputDir The output directory.
--s, --search The string you want to search for, i.e. "../"
--r, --replace The string you want to replace each
occurrence of the search string with.
--ep, --excludePatterns One or many regular expressions that you
want to exclude from each matched search
item, i.e. `-ep "iron.*"`. Can be applied
multiple times: `-ep "one" -ep "two"`.
-h, --help output usage information
The development enviornment has only been used on a macOS & Unix enviornment. Use on Windows at your own risk. The executables from releases (above) should work fine.
Install dependencies
yarn
Run app with babel-node
babel-node index.js [options]
Requires node v8.5.0+
npm run demo # outputs files with replaced locations to ./replaced
yarn
npm run dev # continuous tests, watches files for changes
npm run test