-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add singleFile param to generate everything in one index.html (#62
- Loading branch information
1 parent
c795802
commit d891c5d
Showing
7 changed files
with
2,038 additions
and
2,388 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: Welcome first time contributors | ||
|
||
on: | ||
pull_request: | ||
pull_request_target: | ||
types: | ||
- opened | ||
issues: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
'generate:after': generator => { | ||
|
||
const params = generator.templateParams; | ||
const singleFile = params.singleFile === 'true'; | ||
|
||
if (singleFile) { | ||
|
||
const jsDir = path.resolve(generator.targetDir, 'js'); | ||
const cssDir = path.resolve(generator.targetDir, 'css'); | ||
|
||
const callback = (error) => { | ||
if (error) { | ||
throw error; | ||
} | ||
}; | ||
|
||
fs.rmdir(jsDir, {recursive: true}, callback); | ||
fs.rmdir(cssDir, {recursive: true}, callback); | ||
} | ||
} | ||
}; |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.