When using plugin-babel as a transpiler, the following error is thrown:
ReferenceError: Can't find variable: require
at /path/to/project/node_modules/systemjs-plugin-babel/plugin-babel.js:1
The problem is that karma-systemjs is including plugin-babel by itself into the browser, which has no 'require()' function.
The solution is to have SystemJS handle loading the transpiler.
This should be a simple matter of changing the transpiler's file pattern to just serve: true instead of included: true. However I'm unsure what effect this will have only other transpilers.
Will need to test that this works fine with the latest traceur and typescript too.
When using
plugin-babel
as a transpiler, the following error is thrown:The problem is that
karma-systemjs
is includingplugin-babel
by itself into the browser, which has no 'require()' function.The solution is to have SystemJS handle loading the transpiler. This should be a simple matter of changing the transpiler's file pattern to just
serve: true
instead ofincluded: true
. However I'm unsure what effect this will have only other transpilers. Will need to test that this works fine with the latest traceur and typescript too.