mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-03-16 22:10:32 +00:00
Put window.fabric under a build flag (#4199)
* moved global in a module * fix package.json
This commit is contained in:
parent
a06b568968
commit
b7d9047c9c
4 changed files with 6 additions and 4 deletions
|
|
@ -8,8 +8,6 @@ if (typeof exports !== 'undefined') {
|
|||
if (typeof document !== 'undefined' && typeof window !== 'undefined') {
|
||||
fabric.document = document;
|
||||
fabric.window = window;
|
||||
// ensure globality even if entire library were function wrapped (as in Meteor.js packaging system)
|
||||
window.fabric = fabric;
|
||||
}
|
||||
else {
|
||||
// assume we're running under node.js when document/window are not present
|
||||
|
|
|
|||
2
build.js
2
build.js
|
|
@ -123,7 +123,7 @@ function ifSpecifiedAMDInclude(amdLib) {
|
|||
|
||||
var filesToInclude = [
|
||||
'HEADER.js',
|
||||
|
||||
ifSpecifiedInclude('global', 'src/globalFabric.js'),
|
||||
ifSpecifiedInclude('gestures', 'lib/event.js'),
|
||||
|
||||
'src/mixins/observable.mixin.js',
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build": "node build.js modules=ALL exclude=json,gestures,accessors",
|
||||
"build": "node build.js modules=ALL exclude=gestures,accessors",
|
||||
"build:watch": "onchange 'src/**/**' 'HEADER.js' 'lib/**/**' -- npm run build_export",
|
||||
"build_with_gestures": "node build.js modules=ALL exclude=json",
|
||||
"build_export": "npm run build && npm run export_dist_to_site",
|
||||
|
|
|
|||
4
src/globalFabric.js
Normal file
4
src/globalFabric.js
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
if (typeof document !== 'undefined' && typeof window !== 'undefined') {
|
||||
// ensure globality even if entire library were function wrapped (as in Meteor.js packaging system)
|
||||
window.fabric = fabric;
|
||||
}
|
||||
Loading…
Reference in a new issue