express-systemjs-translate
express-systemjs-translate copied to clipboard
Paths no longer work for me...
Error: express-systemjs-translate: Configuration error. serverRoot is not a parent directory for your jspm configured baseUrl.
serverRoot: /hub/target/hub-1.0-SNAPSHOT
baseUrl: /hub/target/
jspm is configured with baseUrl: '/'
translate('/hub/target/hub-1.0-SNAPSHOT', { debug: true })
No matter what I put in for baseUrl, nothing changes.
Are you using jspm and if you do, could you show me the jspm section of your package.json?
I'm using jspm and systemjs-builder to do my bundling (via gulp). I have two modes that I support, development and production.
Things may be a bit 'odd' in that:
- I use babel to compile to
target/js
- I'm serving development mode out of
target/hub-1.0-SNAPSHOT
- There is a symlink from
target/js -> target/hub-1.0-SNAPSHOT/js
- I'm bundling (with systemjs-builder) several different applications that live under the same root (in the aforementioned
js
folder). - When I bundle for production, I remove the symlink first and just bundle into the folders directly.
- Each separate app loads a different app.js file.
"jspm": {
"main": "app.js",
"directories": {
"lib": "target/js",
"baseURL": "target"
},
"configFiles": {
"jspm:browser": "src/main/jspm.browser.js",
"jspm": "src/main/jspm.config.js"
},
"dependencies": {
},
"devDependencies": {
},
"peerDependencies": {
},
"overrides": {
}
}
Ok. So what happens here is that I assumed when you use jspm that the configuration will always be correct for your web app, meaning baseUrl
and configFile
can be reliably extracted from a jspm instance. This doesn't seem to be the case in your setup.
I can try to look into if it's possible to still configure baseUrl
and configFile
even when using var System = require('jspm').Loader()
.
With this middleware you should be able to skip your babel toolchain entirely and let systemjs handle it. The done work would be cached in the builder instance in the middleware. One of the primary points of creating this middleware in the first place was tool chain simplification :)
I currently need a build step for 'compiling' my angular templates as well... would love to get rid of that too... https://github.com/marklagendijk/gulp-ng-html2js
Your code worked before for me... just sourcemaps were not working. Now nothing works. =)
I recommend staying in v3 until I have time to fix this. I'll look at it later today or tomorrow
No worries on timing.... just trying to help give feedback. =)
I really appreciate it. All the feedback I've been getting here has really helped both strengthen the API and discover some corner cases.
Ping. =)