Package Exports
- rollhtml
- rollhtml/src/index.ts
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rollhtml) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Rollhtml
Rollhtml is a Node.js module for flattening resources of input HTML to the same layer of output folder.
Usage
Command Line
Directly run rollhtml with your HTML file:
# roll HTML
npx rollhtml PATH/TO/SOURCE.html PATH/TO/OUTPUT
# or
npx rollhtml -i PATH/TO/SOURCE.html -o PATH/TO/OUTPUT
# roll HTML with minifying codes and filenames
npx rollhtml PATH/TO/SOURCE.html PATH/TO/OUTPUT -mModule
Install rollhtml:
npm i rollhtmlImport in your code:
import rollhtml from 'rollhtml';
// or
const rollhtml = require('rollhtml');
rollhtml(sourceHtmlPath, {
minify: true,
outputPath: PATH/TO/OUTPUT,
jsOptions: {
// minify options of terser
},
cssOptions: {
// minify options of clean-css
},
htmlOptions: {
// minify options of html-minifier
},
})
.then(() => {
console.log('Done');
})
.catch((error) => {
console.warn(`Error occurs: ${error.message}`);
});License
MIT Copyright @ Wan Wan