Closed NullVoxPopuli closed 8 years ago
Did you add it to the vendorNpmFiles in angular-cli-build.json? Otherwise, they won't appear in the dist directory.
oh ok, I assumed that was automatic.
are there plans for that to be automatic in the future? (maybe via ng install or something?)
anywho, I feel liek I'm doing something wrong. here is my angular-cli-build.js file
/* global require, module */
var Angular2App = require('angular-cli/lib/broccoli/angular2-app');
var renderTemplates = require("broccoli-render-template");
module.exports = function(defaults) {
var app = new Angular2App(defaults, {
vendorNpmFiles: [
'systemjs/dist/system-polyfills.js',
'systemjs/dist/system.src.js',
'zone.js/dist/*.js',
'es6-shim/es6-shim.js',
'reflect-metadata/*.js',
'rxjs/**/*.js',
'@angular/**/*.js',
'js-data/**/*.js',
'js-data-http/**/*.js',
]
});
// // Render all of the jade we have available
var renderedJadeTree = renderTemplates(app, { pretty:true });
return renderedJadeTree;
};
I restarted the server (ng serve), and I still get the 404s. :-(
js-data and js-data-http exist in the node_modules folder.
I'm not an expert on the topic (fighting with it too) and I agree that currently it's not the most user friendly way, but I suspect this will get better in the future. There's a wiki page describing how to integrate 3rd party libs correctly: https://github.com/angular/angular-cli/wiki/3rd-party-libs
what does ember-cli do that makes this process so easy? can that happen with angular-cli?
I found that I had to add this to my system-config.js:
const map: any = {
'@portal': '../src/app',
'js-data': 'vendor/js-data',
'js-data-http': 'vendor/js-data-http',
'traceur': 'vendor/traceur'
};
/** User packages configuration. */
const packages: any = {
'js-data': {
main: 'lib/mindex/index.js'
},
'js-data-http': {
main: 'dist/js-data-http.min.js'
},
'traceur': {
main: 'bin/traceur.js'
}
};
but now I'm getting issues with js-data-http, not sure if it's a configuration issue or not.
I'll close this with mentioning that in order to use any third party library:
gross.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
I'm trying to use js-data, and I 404s to
/js-data
and/js-data-http
, which, I'm like: why?shouldn't that be in application.js or whatever the main file is called?