Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions builder/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,17 @@ function assembleCoreScript() {

function copyModuleScripts() {
modules.forEach(function(moduleFile) {
var moduleCode = fs.readFileSync(srcDir + "modules/" + moduleFile, FILE_ENCODING);
var moduleCode = fs.readFileSync(srcDir + "modules/" + moduleFile, FILE_ENCODING),
filename = path.basename(moduleFile, path.extname(moduleFile));

// Run build directives
moduleCode = moduleCode.replace(/\/\*\s?build:modularizeWithRangyDependency\s?\*\/([\s\S]*?)\/\*\s?build:modularizeEnd\s?\*\//gm, function(match, code) {
//var dependenciesArray = eval(dependencies);
return [
'(function(factory, root) {',
' if (typeof define == "function" && define.amd) {',
' // AMD. Register as an anonymous module with a dependency on Rangy.',
' define(["./rangy-core"], factory);',
' // AMD. Register as a module with a dependency on Rangy.',
' define("' + filename + '", ["./rangy-core"], factory);',
' } else if (typeof module != "undefined" && typeof exports == "object") {',
' // Node/CommonJS style',
' module.exports = factory( require("rangy") );',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rangy",
"description": "A cross-browser DOM range and selection library",
"version": "1.3.1-dev",
"version": "1.3.2",
"author": {
"name": "Tim Down",
"email": "[email protected]",
Expand Down