gulp-jspm-build icon indicating copy to clipboard operation
gulp-jspm-build copied to clipboard

Specify paths

Open SebastianStehle opened this issue 8 years ago • 1 comments

Hi, I try to bundle an angular2 application.

It works from the command line: jspm bundle scripts/app/bootstrap.js with the following config file:

System.config({
  defaultJSExtensions: true,
  transpiler: false,
  paths: {
     "angular2/*": "node_modules/angular2/*.js",
     "rxjs/*": "node_modules/rxjs/*.js"
  }
});

I tried the same with gulp, but it doesnt work. I tries to resovle the angular files from "angular2/core.js" for example:

gulp.task('jspm', function () {
    jspm({
        bundles: [
            {
                src: "wwwroot/scripts/app/bootstrap.js",
                dst: 'bundle.js'
            }
        ],
        configOverride: {
            defaultJSExtensions: true,
            paths: {
                "angular2/*": "wwwroot/node_modules/angular2/*.js",
                "rxjs/*": "wwwroot/node_modules/rxjs/*.js"
            }
        }
    })
    .pipe(gulp.dest(ts.outFolder));
});

Any ideas? Can you also specify jspm to resovle all missing dependencies from node_modules by default?

SebastianStehle avatar Dec 18 '15 13:12 SebastianStehle

I have not tested the plugin with JSPM typescript extension. Does it correctly write the config.js with your specified override? Could you post the content of config.js in ts.outFolder?

buddhike avatar Jan 04 '16 12:01 buddhike