UNPKG

314 BJavaScriptView Raw
1import { readFileSync } from 'sander';
2
3export function defaultLoader ( path, options ) {
4 // TODO support plugins e.g. !css and !json?
5 const source = readFileSync( path, { encoding: 'utf-8' });
6
7 return options.transform.reduce( ( source, transformer ) => {
8 return transformer( source, path );
9 }, source );
10}