-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from tivac/rollup
Rollup plugin & exports rework
- Loading branch information
Showing
9 changed files
with
82 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
"use strict"; | ||
|
||
var path = require("path"), | ||
|
||
through = require("through2"), | ||
sink = require("sink-transform"), | ||
|
||
transform = require("./"); | ||
|
||
module.exports = function browserify(file) { | ||
if(path.extname(file) !== ".js") { | ||
return through(); | ||
} | ||
|
||
return sink.str(function(source, done) { | ||
this.push(transform(source).toString("utf8")); | ||
|
||
done(); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,12 @@ | ||
"use strict"; | ||
|
||
var path = require("path"), | ||
|
||
through = require("through2"), | ||
sink = require("sink-transform"), | ||
falafel = require("falafel"), | ||
var falafel = require("falafel"), | ||
|
||
objectify = require("./src/objectify"); | ||
|
||
function transform(source) { | ||
module.exports = function transform(source) { | ||
return falafel({ | ||
source : source, | ||
ecmaVersion : 6 | ||
}, objectify); | ||
} | ||
|
||
module.exports = function(file) { | ||
if(path.extname(file) !== ".js") { | ||
return through(); | ||
} | ||
|
||
return sink.str(function(source, done) { | ||
this.push(transform(source).toString()); | ||
|
||
done(); | ||
}); | ||
}; | ||
|
||
module.exports.objectify = transform; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
"use strict"; | ||
|
||
var transform = require("./"); | ||
|
||
module.exports = function rollup() { | ||
return { | ||
transformBundle : function(code) { | ||
return { | ||
code : transform(code).toString("utf8") | ||
}; | ||
} | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters