0

Following the guide for integrating angular2-highcharts with Angular2, they're calling for setting a Webpack alias for highcharts/highstock.src.js, like:

alias: { highcharts$: "highcharts/highstock.src.js" }, 

According to one of the answers to this question, there's no way to configure Webpack with Angular-CLI.

I tried running without the alias, and I get an error which I'm not sure is related:

ERROR in ./src/app/graph/graph.component.ts Module build failed: Error: /Users/bradley/Documents/Work/megastore/src/app/graph/graph.component.ts (8,31): Cannot find module 'highcharts/highcharts-3d'.) at _checkDiagnostics (/Users/bradley/Documents/Work/megastore/node_modules/@ngtools/webpack/src/loader.js:116:15) at /Users/bradley/Documents/Work/megastore/node_modules/@ngtools/webpack/src/loader.js:141:17 @ ./src/app/app-routing.module.ts 14:0-57 @ ./src/app/core/core.module.ts @ ./src/app/app.module.ts @ ./src/app/index.ts @ ./src/main.ts @ multi main 

Is there a way set this alias to get angular2-highcharts working in my project?

1 Answer 1

2

Although this isn't covered in the angular2-highcharts documentation, I solved it when trying to implement styled mode (see gevgeny/angular2-highcharts#115). You can alias highcharts in your src/tsconfig.json:

{ "compilerOptions": { ..., "paths": { ..., "highcharts": ["../node_modules/highcharts/highstock.js"] } } 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.