Skip to content

Commit fa92b43

Browse files
author
Mathieu Ghaleb
committed
Merge pull request #12 from Wisembly/amd-support
AMD support
2 parents a2e5210 + deddbd0 commit fa92b43

3 files changed

Lines changed: 25 additions & 3 deletions

File tree

build/basil.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
return new Basil.Storage().init(options);
1717
};
1818

19-
Basil.version = '0.3.0';
19+
Basil.version = '0.3.1';
2020

2121
Basil.options = Object.extend({
2222
namespace: 'b45i1',
@@ -255,6 +255,17 @@
255255
};
256256
};
257257

258+
// browser export
258259
window.Basil = Basil;
259260

261+
// AMD export
262+
if (typeof define === 'function' && define.amd) {
263+
define(function() {
264+
return Basil;
265+
});
266+
// commonjs export
267+
} else if (typeof module !== 'undefined' && module.exports) {
268+
module.exports = Basil;
269+
}
270+
260271
})();

build/basil.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/basil.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
return new Basil.Storage().init(options);
1717
};
1818

19-
Basil.version = '0.3.0';
19+
Basil.version = '0.3.1';
2020

2121
Basil.options = Object.extend({
2222
namespace: 'b45i1',
@@ -255,6 +255,17 @@
255255
};
256256
};
257257

258+
// browser export
258259
window.Basil = Basil;
259260

261+
// AMD export
262+
if (typeof define === 'function' && define.amd) {
263+
define(function() {
264+
return Basil;
265+
});
266+
// commonjs export
267+
} else if (typeof module !== 'undefined' && module.exports) {
268+
module.exports = Basil;
269+
}
270+
260271
})();

0 commit comments

Comments
 (0)