flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
16
BACK_BACK/node_modules/parcel-bundler/lib/utils/getExisting.js
generated
vendored
Executable file
16
BACK_BACK/node_modules/parcel-bundler/lib/utils/getExisting.js
generated
vendored
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
"use strict";
|
||||
|
||||
const fs = require('fs');
|
||||
/**
|
||||
* Creates an object that contains both source and minified (using the source as a fallback).
|
||||
* e.g. builtins.min.js and builtins.js.
|
||||
*/
|
||||
|
||||
|
||||
module.exports = (minifiedPath, sourcePath) => {
|
||||
let source = fs.readFileSync(sourcePath, 'utf8').trim();
|
||||
return {
|
||||
source,
|
||||
minified: fs.existsSync(minifiedPath) ? fs.readFileSync(minifiedPath, 'utf8').trim().replace(/;$/, '') : source
|
||||
};
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue