PatrickJS / NG6-starter

:ng: An AngularJS Starter repo for AngularJS + ES6 + Webpack
https://angularclass.github.io/NG6-starter
Apache License 2.0
1.91k stars 1.35k forks source link

Gulp build on jspm branch fails #25

Open seangwright opened 9 years ago

seangwright commented 9 years ago

When I run gulp build on the jspm branch the build task fails. I don't know enough yet about jspm to understand if this is an issue with the gulp task.

From what I can see, the bundling process is looking for common/common.js file in the wrong location (not relative to app folder).

    $ gulp build
[13:10:11] Using gulpfile c:\dev\tutorials\NG6-starter\Gulpfile.js
[13:10:11] Starting 'build'...
[13:10:12] 'build' errored after 1.27 s
[13:10:12] Error: Error loading "common/common" at file:c:/dev/tutorials/NG6-starter/common/common.js
Error loading "common/common" from "client\app\app" at file:c:/dev/tutorials/NG6-starter/client/app/app.js
ENOENT, open 'c:\dev\tutorials\NG6-starter\common\common.js'
    at Error (native)
MikeJoyce19 commented 9 years ago

+1 I tried messing around with baseUrl and lib paths but that messed things up even further. I think this has to do with potentially the expression that's passed in to bundleSFX

var resolveTo = function(resolvePath) {
    return function(glob) {
        glob = glob || '';
        return path.join(root, resolvePath, glob);
    }
};

var resolveToApp = resolveTo('app'); // app/{glob}
return jspm.bundleSFX(resolveToApp('app'), dist, {})

Replacing the first param to just 'client/app/app' fixes this problem (which is strange because shouldn't that be the exact same as what resolveToApp is doing? I'm thinking that this could be an issue with system.js bundler not being able to handle paths correctly?

Anyways, bundling works after this change but there's then an error with CSS imports and the CSS plugin

danthareja commented 9 years ago

Thanks for filing the issue guys. I'll take a look at this as soon as I get a chance. @MikeJoyce19 do you mind opening another issue for the css error you are getting?

MikeJoyce19 commented 9 years ago

I've also posed this question in the systemjs gitter. I'll link to an issue or response if one is created.

EranSch commented 9 years ago

FYI, I was experiencing the same issue here. My pull request, #52, has been merged and should take care of it... it has for me anyway :smile:

Can anyone else confirm?

kmturley commented 8 years ago

I was getting a similar error:

Using gulpfile ~/Sites/NG6-starter/Gulpfile.js
Starting 'build'...
'build' errored after 895 ms
Error on translate for app/app.js at file:///Users/kimturley/Sites/NG6-starter/client/app/app.js
    Error: ENOENT, open '/Users/kimturley/Sites/NG6-starter/client/jspm_packages/npm/babel-core@5.8.25.js'
    at Error (native)
    Error loading file:///Users/kimturley/Sites/NG6-starter/client/jspm_packages/npm/babel-core@5.8.25.js

I fixed by running this command first:

jspm install