UNPKG

assetgraph

Version:

An auto discovery dependency graph based optimization framework for web pages and applications

30 lines (23 loc) 576 B
const Relation = require('./Relation'); class SourceMapFile extends Relation { set href(href) { this.from.parseTree.file = href; } get href() { return this.from.parseTree.file; } inline() { super.inline(); this.href = this.to.dataUrl + (this.fragment || ''); return this; } attach(position, adjacentRelation) { this.from.parseTree.file = '<urlGoesHere>'; return super.attach(position, adjacentRelation); } detach() { this.from.parseTree.file = undefined; return super.detach(); } } module.exports = SourceMapFile;