Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use fs, fs-extra, remove sander (#4319)
* refactor: use fs.readFileSync * refactor: use fs.existsSync * refactor: use fs.writeFileSync * refactor: use fs.unlinkSync * refactor: use fs.readdirSync * refactor: use fs-extra.removeSync * refactor: use fs-extra.copy/copySync * remove sander * fix test
- Loading branch information
1 parent
7194b88
commit 042933a
Showing
37 changed files
with
1,264 additions
and
1,343 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
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
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
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,12 +1,12 @@ | ||
const assert = require('assert'); | ||
const fs = require('fs'); | ||
const { readFileSync, unlinkSync } = require('fs'); | ||
|
||
module.exports = { | ||
description: 'uses -o from CLI', | ||
command: 'rollup -c -o output.js', | ||
test() { | ||
const output = fs.readFileSync('output.js', 'utf-8'); | ||
const output = readFileSync('output.js', 'utf-8'); | ||
assert.equal(output.trim(), 'console.log(42);'); | ||
fs.unlinkSync('output.js'); | ||
unlinkSync('output.js'); | ||
} | ||
}; |
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,16 +1,16 @@ | ||
const assert = require('assert'); | ||
const fs = require('fs'); | ||
const { readFileSync, unlinkSync } = require('fs'); | ||
|
||
module.exports = { | ||
description: 'omits sourcemap comments', | ||
command: 'rollup -i main.js -f es -m hidden -o output.js', | ||
test() { | ||
assert.equal(fs.readFileSync('output.js', 'utf-8').trim(), 'console.log( 42 );'); | ||
fs.unlinkSync('output.js'); | ||
assert.equal(readFileSync('output.js', 'utf-8').trim(), 'console.log( 42 );'); | ||
unlinkSync('output.js'); | ||
assert.equal( | ||
fs.readFileSync('output.js.map', 'utf-8').trim(), | ||
readFileSync('output.js.map', 'utf-8').trim(), | ||
'{"version":3,"file":"output.js","sources":["main.js"],"sourcesContent":["console.log( 42 );\\n"],"names":[],"mappings":"AAAA,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE"}' | ||
); | ||
fs.unlinkSync('output.js.map'); | ||
unlinkSync('output.js.map'); | ||
} | ||
}; |
Oops, something went wrong.