You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
820 B

10 years ago
var gobble = require( 'gobble' );
var fs = require( 'fs' );
10 years ago
var src = gobble( 'src' );
10 years ago
var node = src
.transform( 'rollup', {
entry: 'rollup.js',
dest: 'rollup.js',
format: 'cjs',
external: [ 'sander', 'acorn' ],
sourceMap: true
})
.transform( 'babel' );
10 years ago
var browserPlaceholders = {
sander: fs.readFileSync( 'browser/sander.js' ).toString()
};
var browser = src
.transform( 'rollup-babel', {
entry: 'rollup.js',
dest: 'rollup.browser.js',
format: 'cjs',
load: function ( id ) {
if ( ~id.indexOf( 'sander.js' ) ) return browserPlaceholders.sander;
return fs.readFileSync( id ).toString();
},
external: [ 'acorn' ]
})
.transform( 'browserify', {
entries: [ './rollup.browser' ],
dest: 'rollup.browser.js',
standalone: 'rollup'
});
module.exports = gobble([ node, browser ]);