diff --git a/config.js b/config.js index 6468ec4..c89ee5c 100644 --- a/config.js +++ b/config.js @@ -29,13 +29,12 @@ module.exports = { sourcemap: true }, browserify: { - basedir: './src/js', debug: true, fullPaths: false, entries: [es6ify.runtime], - prebundle: function(bundle) { - bundle.transform(require('./lib/canopy-transform')); - bundle.transform(es6ify.configure(/^(?!.*node_modules)+.+\.js$/)); - } + }, + prebundle: function(bundle) { + bundle.transform(require('./lib/canopy-transform')); + bundle.transform(es6ify.configure(/^(?!.*node_modules)+.+\.js$/)); } }; diff --git a/gulpfile.js b/gulpfile.js index 577d358..2e83856 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -91,7 +91,7 @@ gulp.task('scripts', function() { .pipe(tap(function(file) { var bundler = browserify(config.browserify); - config.browserify.prebundle(bundler); + config.prebundle(bundler); bundler.add(file.path); diff --git a/karma.conf.js b/karma.conf.js index 6169175..5c62907 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -21,6 +21,10 @@ module.exports = function(karma) { browsers: ['Chrome'], autoWatch: true, singleRun: false, - browserify: config.browserify + browserify: _.extend({ + configure: function(bundle) { + config.prebundle(bundle); + } + }, config.browserify) }); }; diff --git a/package.json b/package.json index 9a88671..1ada2c6 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "gulp-wrap": "^0.11.0", "jasmine-core": "^2.3.4", "karma": "^0.13.14", - "karma-browserify": "^1.0.1", + "karma-browserify": "^4.4.0", "karma-chrome-launcher": "^0.2.1", "karma-jasmine": "^0.3.1", "karma-notify-reporter": "^0.1.1", diff --git a/spec/parser/javascript/any_character_spec.js b/spec/parser/javascript/any_character_spec.js index d55492e..72981fb 100644 --- a/spec/parser/javascript/any_character_spec.js +++ b/spec/parser/javascript/any_character_spec.js @@ -1,4 +1,4 @@ -import javascript from 'src/js/parser/javascript/parser.js'; +import javascript from '../../../src/js/parser/javascript/parser.js'; describe('parser/javascript/any_character.js', function() { diff --git a/spec/parser/javascript/charset_escape_spec.js b/spec/parser/javascript/charset_escape_spec.js index c1b1dd2..c4741ba 100644 --- a/spec/parser/javascript/charset_escape_spec.js +++ b/spec/parser/javascript/charset_escape_spec.js @@ -1,4 +1,4 @@ -import javascript from 'src/js/parser/javascript/parser.js'; +import javascript from '../../../src/js/parser/javascript/parser.js'; import _ from 'lodash'; import Snap from 'snapsvg'; diff --git a/spec/parser/javascript/charset_range_spec.js b/spec/parser/javascript/charset_range_spec.js index 708111d..c1992bb 100644 --- a/spec/parser/javascript/charset_range_spec.js +++ b/spec/parser/javascript/charset_range_spec.js @@ -1,5 +1,5 @@ -import javascript from 'src/js/parser/javascript/parser.js'; -import util from 'src/js/util.js'; +import javascript from '../../../src/js/parser/javascript/parser.js'; +import util from '../../../src/js/util.js'; import _ from 'lodash'; describe('parser/javascript/charset_range.js', function() { diff --git a/spec/parser/javascript/charset_spec.js b/spec/parser/javascript/charset_spec.js index 1a11cd9..2e74b50 100644 --- a/spec/parser/javascript/charset_spec.js +++ b/spec/parser/javascript/charset_spec.js @@ -1,6 +1,6 @@ -import javascript from 'src/js/parser/javascript/parser.js'; -import Node from 'src/js/parser/javascript/node.js'; -import util from 'src/js/util.js'; +import javascript from '../../../src/js/parser/javascript/parser.js'; +import Node from '../../../src/js/parser/javascript/node.js'; +import util from '../../../src/js/util.js'; import _ from 'lodash'; import Snap from 'snapsvg'; diff --git a/spec/parser/javascript/escape_spec.js b/spec/parser/javascript/escape_spec.js index dfd497f..31dab62 100644 --- a/spec/parser/javascript/escape_spec.js +++ b/spec/parser/javascript/escape_spec.js @@ -1,4 +1,4 @@ -import javascript from 'src/js/parser/javascript/parser.js'; +import javascript from '../../../src/js/parser/javascript/parser.js'; import _ from 'lodash'; import Snap from 'snapsvg'; diff --git a/spec/parser/javascript/literal_spec.js b/spec/parser/javascript/literal_spec.js index 0643063..1e57b73 100644 --- a/spec/parser/javascript/literal_spec.js +++ b/spec/parser/javascript/literal_spec.js @@ -1,4 +1,4 @@ -import javascript from 'src/js/parser/javascript/parser.js'; +import javascript from '../../../src/js/parser/javascript/parser.js'; import Snap from 'snapsvg'; describe('parser/javascript/literal.js', function() { diff --git a/spec/parser/javascript/match_fragment_spec.js b/spec/parser/javascript/match_fragment_spec.js index baa3f74..9d949c1 100644 --- a/spec/parser/javascript/match_fragment_spec.js +++ b/spec/parser/javascript/match_fragment_spec.js @@ -1,4 +1,4 @@ -import javascript from 'src/js/parser/javascript/parser.js'; +import javascript from '../../../src/js/parser/javascript/parser.js'; import _ from 'lodash'; import Snap from 'snapsvg'; diff --git a/spec/parser/javascript/match_spec.js b/spec/parser/javascript/match_spec.js index 7ea5e90..a8c8e75 100644 --- a/spec/parser/javascript/match_spec.js +++ b/spec/parser/javascript/match_spec.js @@ -1,5 +1,5 @@ -import javascript from 'src/js/parser/javascript/parser.js'; -import util from 'src/js/util.js'; +import javascript from '../../../src/js/parser/javascript/parser.js'; +import util from '../../../src/js/util.js'; import _ from 'lodash'; import Snap from 'snapsvg'; diff --git a/spec/parser/javascript/node_spec.js b/spec/parser/javascript/node_spec.js index 6e7478a..de378fa 100644 --- a/spec/parser/javascript/node_spec.js +++ b/spec/parser/javascript/node_spec.js @@ -1,4 +1,4 @@ -import Node from 'src/js/parser/javascript/node.js'; +import Node from '../../../src/js/parser/javascript/node.js'; import Snap from 'snapsvg'; describe('parser/javascript/node.js', function() { diff --git a/spec/parser/javascript/parser_state_spec.js b/spec/parser/javascript/parser_state_spec.js index 6467433..37c1f46 100644 --- a/spec/parser/javascript/parser_state_spec.js +++ b/spec/parser/javascript/parser_state_spec.js @@ -1,4 +1,4 @@ -import ParserState from 'src/js/parser/javascript/parser_state.js'; +import ParserState from '../../../src/js/parser/javascript/parser_state.js'; describe('parser/javascript/parser_state.js', function() { diff --git a/spec/parser/javascript/regexp_spec.js b/spec/parser/javascript/regexp_spec.js index 35d714c..5c17009 100644 --- a/spec/parser/javascript/regexp_spec.js +++ b/spec/parser/javascript/regexp_spec.js @@ -1,5 +1,5 @@ -import javascript from 'src/js/parser/javascript/parser.js'; -import util from 'src/js/util.js'; +import javascript from '../../../src/js/parser/javascript/parser.js'; +import util from '../../../src/js/util.js'; import _ from 'lodash'; import Snap from 'snapsvg'; diff --git a/spec/parser/javascript/repeat_any_spec.js b/spec/parser/javascript/repeat_any_spec.js index db24caf..7612f61 100644 --- a/spec/parser/javascript/repeat_any_spec.js +++ b/spec/parser/javascript/repeat_any_spec.js @@ -1,4 +1,4 @@ -import javascript from 'src/js/parser/javascript/parser.js'; +import javascript from '../../../src/js/parser/javascript/parser.js'; describe('parser/javascript/repeat_any.js', function() { diff --git a/spec/parser/javascript/repeat_optional_spec.js b/spec/parser/javascript/repeat_optional_spec.js index 0c84058..761f8fb 100644 --- a/spec/parser/javascript/repeat_optional_spec.js +++ b/spec/parser/javascript/repeat_optional_spec.js @@ -1,4 +1,4 @@ -import javascript from 'src/js/parser/javascript/parser.js'; +import javascript from '../../../src/js/parser/javascript/parser.js'; describe('parser/javascript/repeat_optional.js', function() { diff --git a/spec/parser/javascript/repeat_required_spec.js b/spec/parser/javascript/repeat_required_spec.js index 1da66aa..a386da6 100644 --- a/spec/parser/javascript/repeat_required_spec.js +++ b/spec/parser/javascript/repeat_required_spec.js @@ -1,4 +1,4 @@ -import javascript from 'src/js/parser/javascript/parser.js'; +import javascript from '../../../src/js/parser/javascript/parser.js'; describe('parser/javascript/repeat_required.js', function() { diff --git a/spec/parser/javascript/repeat_spec.js b/spec/parser/javascript/repeat_spec.js index fa803de..f3fc132 100644 --- a/spec/parser/javascript/repeat_spec.js +++ b/spec/parser/javascript/repeat_spec.js @@ -1,4 +1,4 @@ -import javascript from 'src/js/parser/javascript/parser.js'; +import javascript from '../../../src/js/parser/javascript/parser.js'; import _ from 'lodash'; import Snap from 'snapsvg'; diff --git a/spec/parser/javascript/repeat_spec_spec.js b/spec/parser/javascript/repeat_spec_spec.js index 4d79cc7..f61c542 100644 --- a/spec/parser/javascript/repeat_spec_spec.js +++ b/spec/parser/javascript/repeat_spec_spec.js @@ -1,4 +1,4 @@ -import javascript from 'src/js/parser/javascript/parser.js'; +import javascript from '../../../src/js/parser/javascript/parser.js'; describe('parser/javascript/repeat_spec.js', function() { diff --git a/spec/parser/javascript/root_spec.js b/spec/parser/javascript/root_spec.js index bae492b..a7dd1ec 100644 --- a/spec/parser/javascript/root_spec.js +++ b/spec/parser/javascript/root_spec.js @@ -1,4 +1,4 @@ -import javascript from 'src/js/parser/javascript/parser.js'; +import javascript from '../../../src/js/parser/javascript/parser.js'; import Snap from 'snapsvg'; import _ from 'lodash'; diff --git a/spec/parser/javascript/subexp_spec.js b/spec/parser/javascript/subexp_spec.js index 43b6281..cd55938 100644 --- a/spec/parser/javascript/subexp_spec.js +++ b/spec/parser/javascript/subexp_spec.js @@ -1,5 +1,5 @@ -import javascript from 'src/js/parser/javascript/parser.js'; -import Node from 'src/js/parser/javascript/node.js'; +import javascript from '../../../src/js/parser/javascript/parser.js'; +import Node from '../../../src/js/parser/javascript/node.js'; import _ from 'lodash'; import Snap from 'snapsvg'; diff --git a/spec/parser/javascript_spec.js b/spec/parser/javascript_spec.js index 72d90b3..ce18a7b 100644 --- a/spec/parser/javascript_spec.js +++ b/spec/parser/javascript_spec.js @@ -1,5 +1,5 @@ -import Parser from 'src/js/parser/javascript.js'; -import regexpParser from 'src/js/parser/javascript/grammar.peg'; +import Parser from '../../src/js/parser/javascript.js'; +import regexpParser from '../../src/js/parser/javascript/grammar.peg'; import Snap from 'snapsvg'; describe('parser/javascript.js', function() { diff --git a/spec/regexper_spec.js b/spec/regexper_spec.js index 05705d8..9edbb47 100644 --- a/spec/regexper_spec.js +++ b/spec/regexper_spec.js @@ -1,6 +1,6 @@ -import util from 'src/js/util.js'; -import Regexper from 'src/js/regexper.js'; -import Parser from 'src/js/parser/javascript.js'; +import util from '../src/js/util.js'; +import Regexper from '../src/js/regexper.js'; +import Parser from '../src/js/parser/javascript.js'; import Snap from 'snapsvg'; describe('regexper.js', function() { diff --git a/spec/util_spec.js b/spec/util_spec.js index b555364..42382dc 100644 --- a/spec/util_spec.js +++ b/spec/util_spec.js @@ -1,4 +1,4 @@ -import util from 'src/js/util.js'; +import util from '../src/js/util.js'; describe('util.js', function() {