Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
c53d9023fe | |||
1112cfe793 |
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@gitzone/tsbundle",
|
"name": "@gitzone/tsbundle",
|
||||||
"version": "1.0.100",
|
"version": "1.0.101",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@gitzone/tsbundle",
|
"name": "@gitzone/tsbundle",
|
||||||
"version": "1.0.100",
|
"version": "1.0.101",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/core": "^7.17.7",
|
"@babel/core": "^7.17.7",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@gitzone/tsbundle",
|
"name": "@gitzone/tsbundle",
|
||||||
"version": "1.0.100",
|
"version": "1.0.101",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "a bundler using rollup for painless bundling of web projects",
|
"description": "a bundler using rollup for painless bundling of web projects",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
@ -11,18 +11,18 @@ export class HtmlHandler {
|
|||||||
|
|
||||||
// copies the html
|
// copies the html
|
||||||
public async copyHtml(fromArg: string = this.defaultFromPath, toArg: string = this.defaultToPath) {
|
public async copyHtml(fromArg: string = this.defaultFromPath, toArg: string = this.defaultToPath) {
|
||||||
if (!(await this.checkIfExists())) {
|
if (await this.checkIfExists()) {
|
||||||
console.log(`${fromArg} replaces file at ${toArg}`);
|
console.log(`${fromArg} replaces file at ${toArg}`);
|
||||||
}
|
}
|
||||||
fromArg = plugins.smartpath.transform.toAbsolute(fromArg, paths.cwd) as string;
|
fromArg = plugins.smartpath.transform.toAbsolute(fromArg, paths.cwd) as string;
|
||||||
toArg = plugins.smartpath.transform.toAbsolute(toArg, paths.cwd) as string;
|
toArg = plugins.smartpath.transform.toAbsolute(toArg, paths.cwd) as string;
|
||||||
await plugins.smartfile.fs.copy(fromArg, toArg);
|
await plugins.smartfile.fs.copy(fromArg, toArg);
|
||||||
console.log(`html copy replacement succeeded`);
|
console.log(`html copy succeeded!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// copies and minifies the html
|
// copies and minifies the html
|
||||||
public async minifyHtml(fromArg: string = this.defaultFromPath, toArg: string = this.defaultToPath) {
|
public async minifyHtml(fromArg: string = this.defaultFromPath, toArg: string = this.defaultToPath) {
|
||||||
if (!(await this.checkIfExists())) {
|
if (await this.checkIfExists()) {
|
||||||
console.log(`${fromArg} replaces file at ${toArg}`);
|
console.log(`${fromArg} replaces file at ${toArg}`);
|
||||||
}
|
}
|
||||||
fromArg = plugins.smartpath.transform.toAbsolute(fromArg, paths.cwd) as string;
|
fromArg = plugins.smartpath.transform.toAbsolute(fromArg, paths.cwd) as string;
|
||||||
@ -39,5 +39,6 @@ export class HtmlHandler {
|
|||||||
removeComments: true,
|
removeComments: true,
|
||||||
});
|
});
|
||||||
await plugins.smartfile.memory.toFs(minifiedHtml, toArg);
|
await plugins.smartfile.memory.toFs(minifiedHtml, toArg);
|
||||||
|
console.log(`html minification succeeded!`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user