These are chat archives for systemjs/systemjs

3rd
Jan 2019
Mao Zedong
@untilted-document
Jan 03 17:51
Hi peeps. Wondering if anyone can give some pointers on why my project suffers "require is not defined" errors?
The first question is actually a config one - I've put my systemjs config in a block of json and loaded it on my page with <script type="systemjs-packagemap" src="/Scripts/Discussion/system.config.json">, the config defines packages.app.main as "./main.js" and now system.js expects my app is at /scripts/discussion/app/main.js - can't work out where the extra "app" folder came from. I have to configure the packages.app.main as "../main.js" to get it to load
Mao Zedong
@untilted-document
Jan 03 18:14
But then i hit the "require is not defined" - my reading around seems to indicate that having module: commonjs in my tsconfig.json might be a problem,and it should be "system" ? The other curiosity for me is that in Visual Studio projects where a tsconfig is present, the built in UI for configuring TypeScript options is supposed to disable itself, but mine hasn't, so I can set these options in 2 places, and they aren't the same in each place; when VS invokes tsc.exe it uses the UI settings (commonjs) to transpile. I've hence no idea what purpose if any, the tsconfig file serves. If I set the module system in the UI to "system" I get hundreds of errors about not being able to find modules, so if I am supposed to have a modulesystem of "system" to get systemjs to work, I'm not sure what to do/where to set it
(If i set it in the ui, tsc fails the build. if I set it in the tsconfig, it seems ignored)