index.js 401 B

1234567891011121314
  1. //modified https://github.com/grieve/webpack-glsl-loader/blob/master/index.js
  2. let parser = require('./parser')
  3. module.exports = function (source) {
  4. this.cacheable();
  5. var cb = this.async();
  6. parser(this, source, this.context, function (err, bld) {
  7. if (err) {
  8. return cb(err);
  9. }
  10. cb(null, 'module.exports = ' + JSON.stringify(bld));
  11. });
  12. };