flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
36
VISUALIZACION/node_modules/parcel-bundler/lib/assets/RawAsset.js
generated
vendored
Executable file
36
VISUALIZACION/node_modules/parcel-bundler/lib/assets/RawAsset.js
generated
vendored
Executable file
|
|
@ -0,0 +1,36 @@
|
|||
'use strict';
|
||||
|
||||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
|
||||
|
||||
const Asset = require('../Asset');
|
||||
const urlJoin = require('../utils/urlJoin');
|
||||
const md5 = require('../utils/md5');
|
||||
|
||||
class RawAsset extends Asset {
|
||||
// Don't load raw assets. They will be copied by the RawPackager directly.
|
||||
load() {}
|
||||
|
||||
generate() {
|
||||
// Don't return a URL to the JS bundle if there is a bundle loader defined for this asset type.
|
||||
// This will cause the actual asset to be automatically preloaded prior to the JS bundle running.
|
||||
if (this.options.bundleLoaders[this.type]) {
|
||||
return {};
|
||||
}
|
||||
|
||||
const pathToAsset = urlJoin(this.options.publicURL, this.generateBundleName());
|
||||
|
||||
return {
|
||||
js: `module.exports=${JSON.stringify(pathToAsset)};`
|
||||
};
|
||||
}
|
||||
|
||||
generateHash() {
|
||||
var _this = this;
|
||||
|
||||
return _asyncToGenerator(function* () {
|
||||
return yield md5.file(_this.name);
|
||||
})();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = RawAsset;
|
||||
Loading…
Add table
Add a link
Reference in a new issue