SotM_Playfield/src/RawStringAsset.js

17 lines
323 B
JavaScript
Raw Normal View History

2019-01-12 16:56:37 -05:00
const { Asset } = require('parcel-bundler');
class RawStringAsset extends Asset {
constructor(filename, options) {
super(filename, options);
this.type = 'js';
}
parse(str) {
return JSON.stringify(str);
}
generate() {
return `module.exports = ${this.ast}`;
}
}
module.exports = RawStringAsset;