Skip to content

Commit

Permalink
Fixes for webpack, browserify
Browse files Browse the repository at this point in the history
  • Loading branch information
chill117 committed Jun 13, 2016
1 parent 2ae31ea commit 75f2299
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 28 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
13-06-2016 (v0.9.10)
* Fixes for webpack, browserify

31-05-2016 (v0.9.9)
* JointJS:
* Added env namespace with env.test(name) and env.addTest(name, fn) methods
Expand Down
6 changes: 3 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ module.exports = function(grunt) {
webpack: {
joint: {
files: {
'./build/joint.webpack-bundle.js' : './build/joint.min.js'
'./build/joint.webpack-bundle.js' : './build/joint.js'
},
entry: './build/joint.min.js',
entry: './index.js',
output: {
path: './build/',
filename: 'joint.webpack-bundle.js',
Expand All @@ -129,7 +129,7 @@ module.exports = function(grunt) {
browserify: {
joint: {
files: {
'build/joint.browserify-bundle.js': 'build/joint.min.js'
'build/joint.browserify-bundle.js': 'index.js'
},
options: {
browserifyOptions: {
Expand Down
24 changes: 1 addition & 23 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,3 @@
'use strict';

var fs = require('fs');

var possiblePaths = ['./build/joint.js', './dist/joint.js'];
var filePath;

while ((filePath = possiblePaths.shift())) {

try {
fs.statSync(__dirname + '/' + filePath);
} catch (error) {
// Try another path.
continue;
}

// Found a path that exists.
break;
}

if (!filePath) {
throw new Error('JointJS build file not found.');
}

module.exports = require(filePath);
module.exports = require('./dist/joint');
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"scripts": {
"test": "grunt test"
},
"version": "0.9.9",
"version": "0.9.10",
"main": "./dist/joint.js",
"homepage": "http://jointjs.com",
"author": {
"name": "client IO",
Expand Down
5 changes: 4 additions & 1 deletion test/jointjs-nodejs/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
'use strict';

var should = require('should');

var joint = require('../../index');
// Test against the latest JointJS build file.
var joint = require('../../build/joint');

describe('Sanity check', function() {

Expand Down

0 comments on commit 75f2299

Please sign in to comment.