Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put window.fabric under a build flag #4199

Merged
merged 2 commits into from
Aug 14, 2017
Merged
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
2 changes: 0 additions & 2 deletions HEADER.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions src/globalFabric.js
Original file line number Diff line number Diff line change
@@ -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;
}