lib/client/bundler/index.js
function loadFile(entry, opts, formatter, cb, errCb) {
      var type = entry.assetType || entry.bundle;
      formatter = formatter || ss.client.formatters[entry.ext || type];
      if (!formatter) {
        throw new Error('Unsupported file extension \'.' + entry.ext + '\' when we were expecting some type of ' +
          ((type||'unknown').toUpperCase()) + ' file. Please provide a formatter for ' + (entry.file) + ' or move it to /client/static');
      }
      if (formatter.assetType !== type) {
        throw new Error('Unable to render \'' + entry.file + '\' as this appears to be a ' + (type.toUpperCase()) +
          ' file. Expecting some type of ' + (type.toUpperCase()) + ' file in ' + (path.dirname(entry.file)) + ' instead');
      }

      // Use the formatter to pre-process the asset before bundling
      try {
        return formatter.call(this.clientFilePath(entry.file), opts, cb, errCb);
      } catch (err) {
        return errCb(err);
      }
    }
function loadFile(entry, opts, formatter, cb, errCb) {
      var type = entry.assetType || entry.bundle;
      formatter = formatter || ss.client.formatters[entry.ext || type];
      if (!formatter) {
        throw new Error('Unsupported file extension \'.' + entry.ext + '\' when we were expecting some type of ' +
          ((type||'unknown').toUpperCase()) + ' file. Please provide a formatter for ' + (entry.file) + ' or move it to /client/static');
      }
      if (formatter.assetType !== type) {
        throw new Error('Unable to render \'' + entry.file + '\' as this appears to be a ' + (type.toUpperCase()) +
          ' file. Expecting some type of ' + (type.toUpperCase()) + ' file in ' + (path.dirname(entry.file)) + ' instead');
      }

      // Use the formatter to pre-process the asset before bundling
      try {
        return formatter.call(this.clientFilePath(entry.file), opts, cb, errCb);
      } catch (err) {
        return errCb(err);
      }
    }
function loadFile ( entry , opts , formatter , cb , errCb ) { var type = entry . assetType || entry . bundle ; formatter = formatter || ss . client . formatters [ entry . ext || type ] ; if ( ! formatter ) { throw new Error ( 'Unsupported file extension \'.' + entry . ext + '\' when we were expecting some type of ' + ( ( type || 'unknown' ) . toUpperCase ( ) ) + ' file. Please provide a formatter for ' + ( entry . file ) + ' or move it to /client/static' ) ; } if ( formatter . assetType !== type ) { throw new Error ( 'Unable to render \'' + entry . file + '\' as this appears to be a ' + ( type . toUpperCase ( ) ) + ' file. Expecting some type of ' + ( type . toUpperCase ( ) ) + ' file in ' + ( path . dirname ( entry . file ) ) + ' instead' ) ; } // Use the formatter to pre-process the asset before bundling try { return formatter . call ( this . clientFilePath ( entry . file ) , opts , cb , errCb ) ; } catch ( err ) { return errCb ( err ) ; } }
API for implementing bundlers
API for implementing bundlers