These are chat archives for systemjs/systemjs

13th
Jul 2017
Patricio Ferreira
@kuakman
Jul 13 2017 00:49
So, Started to get frustrated with SystemJs/Jspm… got really close to what I wanted but still facig issues with bundles and extensions, path mapping
Here is the project I have been working on for a few days, if anyone is interested looking at
trying to setup the classic workflows: test, dev and prod
got test and dev working, but production still have some issues with bundles
Nick George
@Izzmo
Jul 13 2017 01:04
@kuakman What are you using to push to your different environments? Is your dev local?
Patricio Ferreira
@kuakman
Jul 13 2017 01:05
yea pretty much
using gulp and npm scripts, so the goal is run one time commands to prebundle third party libraries for each environment
so developers can do
npm run test (pre bundles libraries-test and runs karma)
npm run dev (pre bundles libraries-dev and runs lite-server)
npm run prod (prebundles libraries and runs lite server to have a preview how that app should run in production)
with all the optimizations and bundles
Nick George
@Izzmo
Jul 13 2017 01:24

so what problems are you having with your PROD environment? How I've set mine up is basically they all run the same thing but bundling is only done on TEST and PRD (basically we run a TEST, QA, Staging, and PRD which are all identical as far as deployments go with just diff configuration settings).

Our local/dev environment is the only one where we run unminimized, unbundled.

Patricio Ferreira
@kuakman
Jul 13 2017 01:29
Right, let me explain a little bit more…. the project I mentioned has the same setup and you are describing...
the difference, is I’m pre bundling the thirdparty libraries to help streamline systemjs to not have to load all the dependencies and sub dependencies of big frameworks like react or even enzyme. so in one shot (request), you load all these dependencies in one bundle.
the project code follows the same description as you mentioned, with one exception
test and dev, transpile typescript code on the fly by using systemjs
Patricio Ferreira
@kuakman
Jul 13 2017 01:36
one of the problems I’m dealing with is the paths normalized by the bundler...
let paste some screenshots
and this one is the app using the production profile (preview)
Patricio Ferreira
@kuakman
Jul 13 2017 01:43
if you look at the System.register declaration in the home-bundle file, it includes the extension tsx so I’m having problems to hit that via the bundles configuration shown in the second screenshot
not sure if SystemJS Builder provides a hook in the configuration to override that path and pick the strategy that solve my problem
Nick George
@Izzmo
Jul 13 2017 01:48
So, basically it looks like it's trying to load the .js files which aren't in there, and the bundler is still using the .ts and .tsx files, right?
The bundler should be pointing to the .js files instead, right? So... home-bundle.js -> home.js, etc.?
Patricio Ferreira
@kuakman
Jul 13 2017 01:49
right, I tried to use everything tsx
And that will get the error away
but the browser doesn’t interpret the tsx
maybe because a mime type issue
Nick George
@Izzmo
Jul 13 2017 01:50
Are you not transpiling before you output in browser?
Patricio Ferreira
@kuakman
Jul 13 2017 01:50
not sure
yes
the first screenshot shows the bundle home-bundle.js with all the dependencies and the code transpiled
that’s the production profile
Hey, not sure if I should chat you privately, I don’t want to bother all the people here
Nick George
@Izzmo
Jul 13 2017 01:51
The first screenshot look likes it still shows .ts and .tsx files.
Sure, you can pm me.
Patricio Ferreira
@kuakman
Jul 13 2017 01:52
ok thanks
Eric Reichert
@ereichert
Jul 13 2017 14:56
Hi. I'm using webjars with the Play Framework. The JS libs are available at "libs/<lib_name>/<lib_name>.js". I have set baseURL to "libs" and defaultExtension = true. That leaves the maps looking like "lib_name": "lib_name/lib_name" because the default systemjs uses (effectively) is just "lib_name": "lib_name.js". Is there a way to change the default behavior so that systemjs will automatically prepend the directory name?