-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add benchmarks for creating sourcemaps
- Loading branch information
1 parent
d42036a
commit e68f6f7
Showing
2 changed files
with
69 additions
and
2 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
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,67 @@ | ||
/* Results on Node 20.3.1, Github Actions: | ||
TODO | ||
*/ | ||
|
||
let { existsSync, readFileSync } = require('fs') | ||
let { join } = require('path') | ||
const postcss = require('postcss') | ||
|
||
let example = join(__dirname, 'cache', 'bootstrap.css') | ||
let css = readFileSync(example).toString() | ||
|
||
module.exports = { | ||
maxTime: 15, | ||
name: 'Sourcemaps', | ||
tests: [ | ||
{ | ||
defer: true, | ||
fn: done => { | ||
{ | ||
let root = postcss.parse(css, { from: example }) | ||
root.toResult({ map: { inline: false }, to: 'dist/bootstrap.css' }).map.toJSON() | ||
} | ||
|
||
{ | ||
let root = postcss.parse(css, { from: example }) | ||
root.toResult({ map: { absolute: true, inline: false }, to: 'dist/bootstrap.css' }).map.toJSON() | ||
} | ||
|
||
{ | ||
let root = postcss.parse(css, { from: example }) | ||
root.toResult({ map: { inline: true }, to: 'dist/bootstrap.css' }) | ||
} | ||
|
||
done.resolve() | ||
}, | ||
name: 'PostCSS' | ||
} | ||
] | ||
} | ||
|
||
let devPath = join(__dirname, '../postcss/lib/postcss.js') | ||
if (existsSync(devPath)) { | ||
let devPostcss = require(devPath) | ||
module.exports.tests.splice(1, 0, { | ||
defer: true, | ||
fn: done => { | ||
{ | ||
let root = devPostcss.parse(css, { from: example }) | ||
root.toResult({ map: { inline: false }, to: 'dist/bootstrap.css' }).map.toJSON() | ||
} | ||
|
||
{ | ||
let root = devPostcss.parse(css, { from: example }) | ||
root.toResult({ map: { absolute: true, inline: false }, to: 'dist/bootstrap.css' }).map.toJSON() | ||
} | ||
|
||
{ | ||
let root = devPostcss.parse(css, { from: example }) | ||
root.toResult({ map: { inline: true }, to: 'dist/bootstrap.css' }) | ||
} | ||
|
||
done.resolve() | ||
}, | ||
name: 'Next PostCSS' | ||
}) | ||
} |