Skip to content

Commit 9fdffdb

Browse files
author
James Halliday
committed
example works
0 parents  commit 9fdffdb

File tree

5 files changed

+28
-0
lines changed

5 files changed

+28
-0
lines changed

example/browser/bar.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = function (n) {
2+
return n * 100;
3+
};

example/browser/foo.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var bar = require('./bar');
2+
3+
module.exports = function (n) {
4+
return n * 111 + bar(n);
5+
};

example/browser/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
var foo = require('./foo');
2+
console.log('main: ' + foo(5));

example/browser/xyz.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
var foo = require('./foo');
2+
console.log('xyz: ' + foo(6));

example/bundle.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
var splicer = require('../');
2+
var through = require('through2');
3+
var deps = require('module-deps');
4+
var pack = require('browser-pack');
5+
6+
var pipeline = splicer.obj([
7+
'deps', [ deps(__dirname + '/browser/main.js') ],
8+
'pack', [ pack({ raw: true }) ],
9+
process.stdout
10+
]);
11+
12+
pipeline.get('deps').push(through.obj(function (row, enc, next) {
13+
row.source = row.source.toUpperCase();
14+
this.push(row);
15+
next();
16+
}));

0 commit comments

Comments
 (0)