1 | import { readFileSync } from 'sander';
|
2 |
|
3 | export 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 | }
|