When a script contains the text System.register then StealJS seams to assume that this file is a SystemJS module. That would be fine if the file actually did call System.register() but actually my script calls FileSystem.registerFileSystem() which has nothing to do with SystemJS. Looks like the regular expression which looks for System.register is not exact enough. Maybe it could simply be changed to /\bSystem\.register/?
Steal should load the dependency fs.js (or complain that this file could not be loaded).
Actual results:
The error ReferenceError: require is not defined is thrown: I think this is because StealJS assumes the file is a SystemJS module instead of a CommonJS module and therefor doesn't provide the require function.
Remove the second line in the example or change it so it doesn't match System.register and then it works correctly.
How often can you reproduce it?
Description:
When a script contains the text System.register then StealJS seams to assume that this file is a SystemJS module. That would be fine if the file actually did call System.register() but actually my script calls FileSystem.registerFileSystem() which has nothing to do with SystemJS. Looks like the regular expression which looks for
System.register
is not exact enough. Maybe it could simply be changed to/\bSystem\.register/
?Steps to reproduce:
Try to load a file with the following content:
Expected results:
Steal should load the dependency
fs.js
(or complain that this file could not be loaded).Actual results:
The error
ReferenceError: require is not defined
is thrown: I think this is because StealJS assumes the file is a SystemJS module instead of a CommonJS module and therefor doesn't provide the require function.Remove the second line in the example or change it so it doesn't match System.register and then it works correctly.
Environment: