Skip to content

Separated bundle #51

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

Merged
merged 4 commits into from
Apr 7, 2019
Merged

Separated bundle #51

merged 4 commits into from
Apr 7, 2019

Conversation

andrefarzat
Copy link
Collaborator

closes #50

Separates plotly.js from angular-plotly.js code, so ng build --prod works with both PlotlyViaWindowModule and PlotlyViaCDNModule as expected

@andrefarzat andrefarzat self-assigned this Mar 24, 2019
@coveralls
Copy link

Pull Request Test Coverage Report for Build 106

  • 8 of 8 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.8%) to 97.101%

Totals Coverage Status
Change from base Build 102: 1.8%
Covered Lines: 206
Relevant Lines: 210

💛 - Coveralls

@orangeswim
Copy link

I tried using this branch to see if plotly was getting bundled but am encountering this error
ERROR in ./node_modules/angular-plotly.js/index.ts Module build failed (from ./node_modules/@ngtools/webpack/src/index.js): Error: E:\Docker\ngxp\src\budgetRoad\node_modules\angular-plotly.js\index.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv). at AngularCompilerPlugin.getCompiledFile (E:\Docker\ngxp\src\budgetRoad\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:752:23) at plugin.done.then (E:\Docker\ngxp\src\budgetRoad\node_modules\@ngtools\webpack\src\loader.js:41:31) at process._tickCallback (internal/process/next_tick.js:68:7)

This was after doing a npm uninstall then installing the via npm install plotly/angular-plotly.js#separate-bundle

@andrefarzat
Copy link
Collaborator Author

@orangeswim unfortunately, angular packages don't work like that. I would recommend you to git clone this repo, switching to separated-bundle, run npm install, then use it as a regular angular project with ng serve and ng build --prod commands. The scripts I use to build and publish to npm are: ./bin/build and ./bin/publish. Please, check'em out too to see the final result.

@orangeswim
Copy link

Im at work right now
But I did that last night and it had an error trying to resolve some files. I'll redo it from a clean slate tonight and post the result.
Thanks for the quick responses!

@orangeswim
Copy link

It built fine as a local package. I was having issues using npm link from my project to the local package. After trying to figure out how to get that to work for an hour, I just copied the local-package/dist to my node_modules/angular-plotly.js.

So summary. It works! plotly.js is not bundled with and without --prod. Thanks again for the fix. Much appreciated!

@andrefarzat
Copy link
Collaborator Author

@orangeswim thanks a lot for the feedback. I will be finishing up another thing and will merge this PR soon and publish the next version

@andrefarzat andrefarzat merged commit a4aeb72 into master Apr 7, 2019
@andrefarzat andrefarzat deleted the separated-bundle branch April 7, 2019 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

plotly.js always gets bundled
3 participants