-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add
minifySync
and examples (#12)
- Loading branch information
Showing
8 changed files
with
34 additions
and
25 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,6 +1,5 @@ | ||
# Built files | ||
*.js | ||
!index.js | ||
!binding.js | ||
*.map | ||
*.d.ts | ||
|
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,24 @@ | ||
const swc = require("../lib/index.js"); | ||
|
||
const css = ` | ||
.foo { | ||
color: #FFFFFF; | ||
margin: 20px; | ||
margin-bottom: 10px; | ||
} | ||
`; | ||
|
||
async function main() { | ||
console.time("🚀 minify Time"); | ||
const output = await swc.minify(Buffer.from(css), {}); | ||
console.timeEnd("🚀 minify Time"); | ||
console.log(output.code.length + " bytes"); | ||
console.log(output.code, "\n"); | ||
} | ||
main(); | ||
|
||
console.time("🚀 minifySync Time"); | ||
const outputSync = swc.minifySync(Buffer.from(css), {}); | ||
console.timeEnd("🚀 minifySync Time"); | ||
console.log(outputSync.code.length + " bytes"); | ||
console.log(outputSync.code, "\n"); |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
"version": "0.0.11", | ||
"description": "Super-fast alternative for postcss", | ||
"homepage": "https://swc.rs", | ||
"main": "./index.js", | ||
"main": "./lib/index.js", | ||
"author": "강동윤 <[email protected]>", | ||
"license": "Apache-2.0", | ||
"keywords": [ | ||
|
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
"version": "0.0.11", | ||
"description": "Super-fast alternative for posthtml", | ||
"homepage": "https://swc.rs", | ||
"main": "./index.js", | ||
"main": "./lib/index.js", | ||
"author": "강동윤 <[email protected]>", | ||
"license": "Apache-2.0", | ||
"keywords": [ | ||
|