rolaveric / karma-systemjs

Karma plugin for using SystemJS as a module loader
MIT License
40 stars 19 forks source link

`ReferenceError: Can't find variable: require` when using `plugin-babel` #73

Closed rolaveric closed 8 years ago

rolaveric commented 8 years ago

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.

rolaveric commented 8 years ago

Fixed by 389bba969aad99d4a066754e043d8d45d0a8733f