-
Notifications
You must be signed in to change notification settings - Fork 12k
Production Build Vendor Files Missing #785
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
Comments
When I follow the steps for adding @angular2-material, the components are correctly available in the production build. |
@mb-jenks |
Yes i'm using npm to install D3 |
Supposing you did... npm install d3 --save
#Don't forget to add typings as well
typings install d3 --save; Configure your third party dependency like this const map: any = {
'd3': 'vendor/d3'
};
/** User packages configuration. */
const packages: any = {
'd3': { main: 'd3' }
};
--------------------
var Angular2App = require('angular-cli/lib/broccoli/angular2-app');
module.exports = function(defaults) {
return new Angular2App(defaults, {
vendorNpmFiles: [
...
'd3/d3.js'
]
});
};
------------
// Make sure somewhere into your app you import and use the package
import * as d3 from 'd3';
console.log(d3); // Just for demo purpose...
Following this, running the prod build will both copy your lib in ./dist and bundle it in .dist/main.js |
Update: By adding d3 to the packages with the following information, I was able to get it to run. Thanks for the help!
|
angular-cli: 1.0.0-beta.5 Hello. I have read the docs and this thread and I am running into similar issues.
I make the modifications instructed above. You can view my diff here. When building, I receive an error indicating Any help is much appreciated. Thanks. |
@ehaydenr |
Yes. |
Is it possible to share the project? |
I can't at the moment. Will do later this evening. It should be fairly easy to reproduce though. The steps I outlined above made only a few modifications to the |
Did a fresh install and it worked |
Tried it on my other machine and it still fails. Could it be related to the Here's the project: https://github.com/ehaydenr/d3angular2
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I've added d3.js to my project and mapped it according to the documentation. Everything works fine with the dev builds, but when I try to build for production 'ng build -prod' , the d3 files are not copied to the /dist folder. Here's my system-config.ts and angular-cli-build.js.
My app is unable to run in production mode because of this. Any idea?
The text was updated successfully, but these errors were encountered: