Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on fetch for @angular/core #22

Open
impworks opened this issue Jul 15, 2016 · 1 comment
Open

Error on fetch for @angular/core #22

impworks opened this issue Jul 15, 2016 · 1 comment

Comments

@impworks
Copy link

Angular2 used to provide SystemJS bundles in their older package (angular2), but they stopped doing so after RC. I tried to use gulp-jspm-build to create such a package myself, but a nasty error keeps popping up.

Ideally, I would like to have just one angular.js file with all core modules concatenated. It will be included onto the page in a script tag, so that no modules will have to be dynamically loaded at runtime.

I started small, with just one module. Here is the gulpfile.js:

var gulp = require('gulp'),
    jspm = require('gulp-jspm-build');

gulp.task('libs:angular', function() {
    jspm({
        config: './system.config.js',
        bundleOptions: {
            minify: false,
            mangle: false
        },
        bundles: [
            { src: '@angular/core', dst: 'angular.js' }
        ]
    })
    .pipe(gulp.dest(paths.assets.js));
});

And here is system.config.js:

System.config({
    defaultJSExtensions: true,
    paths: {
        "*": "node_modules/*"
    },
    packages: {
        '@angular/core': { main: 'index.js', defaultExtension: 'js' }
    }
});

The following error shows up:

Error on fetch for @angular/core at file:///C:/tests/WebTest/@angular/core
    Error: ENOENT: no such file or directory, open 'C:\tests\WebTest\@angular\core'
    at Error (native)

The root folder (where gulpfile.js and system.config.js are stored) is C:\tests\WebTest. The correct folder for @angular/core would be C:\tests\WebTests\node_modules\@angular\core.

My config file does not seem to be loaded at all. Even when I mess it up, add syntax errors or even specify an invalid path to it, the error does not change. Copying the entire config into configOverride section does not change anything either.

What am I doing wrong?

@impworks
Copy link
Author

Looks like the "config" property is stated in the documentation, but is actually ignored in the code:

https://github.com/buddyspike/gulp-jspm-build/blob/master/lib/build.js#L18

Temporary workaround: rename system.config.js to just config.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant