back to commonjs

This commit is contained in:
Anton Lavrenov 2019-02-27 17:30:47 -05:00
parent a383b982f3
commit daed263c6a
5 changed files with 14 additions and 16 deletions

View File

@ -1,8 +1,7 @@
(function (global, factory) { (function (factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) : typeof define === 'function' && define.amd ? define(factory) :
(global = global || self, global.Konva = factory()); factory();
}(this, function () { 'use strict'; }(function () { 'use strict';
/* /*
* Konva JavaScript Framework v3.1.3 * Konva JavaScript Framework v3.1.3
@ -17092,11 +17091,10 @@
_registerNode: _registerNode _registerNode: _registerNode
}); });
// add Konva to global viriable // add Konva to global variable
// umd build will actually do it // umd build will actually do it
// but it may now it case of modules and bundlers // but it may now it case of modules and bundlers
_injectGlobal(Konva); _injectGlobal(Konva);
module.exports = Konva;
return Konva;
})); }));

4
konva.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,8 +1,8 @@
import * as Konva from './_CoreInternals'; import * as Konva from './_CoreInternals';
// add Konva to global viriable // add Konva to global variable
// umd build will actually do it // umd build will actually do it
// but it may now it case of modules and bundlers // but it may now it case of modules and bundlers
Konva._injectGlobal(Konva); Konva._injectGlobal(Konva);
export default Konva; module.exports = Konva;

View File

@ -1,8 +1,8 @@
import * as Konva from './_FullInternals'; import * as Konva from './_FullInternals';
// add Konva to global viriable // add Konva to global variable
// umd build will actually do it // umd build will actually do it
// but it may now it case of modules and bundlers // but it may now it case of modules and bundlers
Konva._injectGlobal(Konva); Konva._injectGlobal(Konva);
export default Konva; module.exports = Konva;

View File

@ -5,7 +5,7 @@ function equal(val1, val2, message) {
} }
// try to import only core // try to import only core
let Konva = require('../lib/Core').default; let Konva = require('../lib/Core');
// no external shapes // no external shapes
equal(Konva.Rect, undefined, 'no external shapes'); equal(Konva.Rect, undefined, 'no external shapes');
@ -15,7 +15,7 @@ let Rect = require('../lib/shapes/Rect').Rect;
equal(Rect !== undefined, true, 'Rect is defined'); equal(Rect !== undefined, true, 'Rect is defined');
// now import from package.json // now import from package.json
let NewKonva = require('../').default; let NewKonva = require('../');
equal(NewKonva.Rect, Rect, 'Same rects'); equal(NewKonva.Rect, Rect, 'Same rects');