Is it possible to compile angular libraries into one single js file?
For example, I am using gulp to copy all the angular libs into a single js
file that I am referencing in my angular application. This seems to cause
console errors in chrome; however, if I reference the dependencies
directly, I don't have any issues.
gulp.task("build:libraries", () => {
return gulp
.src([
resolve("./node_modules/es6-shim/es6-shim.js"),
resolve("./node_modules/systemjs/dist/system-polyfills.js"),
resolve("./node_modules/angular2/bundles/angular2-polyfills.js"),
resolve("./node_modules/systemjs/dist/system.src.js"),
resolve("./node_modules/rxjs/bundles/Rx.js"),
resolve("./node_modules/angular2/bundles/angular2.dev.js"),
resolve("./node_modules/angular2/bundles/router.dev.js")
])
.pipe(concat("libraries.js"))
.pipe(uglify())
.pipe(gulp.dest(resolve("./www/scripts")));
});
The above gulp task is combining all the listed js files into a
"libraries.js" file that I am referencing. This doesn't appear to work.
script(src="node_modules/es6-shim/es6-shim.js")
script(src="node_modules/systemjs/dist/system-polyfills.js")
script(src="node_modules/angular2/bundles/angular2-polyfills.js")
script(src="node_modules/systemjs/dist/system.src.js")
script(src="node_modules/rxjs/bundles/Rx.js")
script(src="node_modules/angular2/bundles/angular2.dev.js")
script(src="node_modules/angular2/bundles/router.dev.js")
The above (written in jade/pug) is referencing the files from their
node_modules directory and this seems to work fine.
The error I am receiving is rather lengthy but here is the short version of
it "Uncaught (in promise): No provider for t! (t -> t)".
Is there a reason why the first one doesn't work but the second one does?
Are these libraries trying to fetch other local libraries behind the scenes?
Thank you in advance!
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.