git clone https://github.com/WebReflection/ucdn-test.git
cd ucdn-test
npm i
npm run build
Source code is in the ./src
folder. Once ucdn starts, it creates a ./cdn
folder with all assets pre-optimized and pre-compressed.
Whenever a file changes, and the browser requests it, it will be re-generated with a cache lasting 1 second.
The cache can be increased or reduced via the --cache-timeout XXXX
argument, where XXXX
are milliseconds.
To discover all flags available in both ucdn and ucompress, feel free to run npm run help:cdn
or npm run help:compress
.
While backend/processing dependencies should be defined in this project root, all front-end related dependencies should be defined in the ./src/package.json
file. This is necessary in order to pre-resolve paths within the root of the front-end folder, but don't worry, only files related to the project will be optimized, once published, and JS files will automatically resolve to those dependencies as relative path, i.e. ../node_modules/uhtml/esm/index.js
.