Skip to content
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

How to include 3rd party libs #6

Open
Adam-Michalski opened this issue Oct 18, 2016 · 2 comments
Open

How to include 3rd party libs #6

Adam-Michalski opened this issue Oct 18, 2016 · 2 comments

Comments

@Adam-Michalski
Copy link

Adam-Michalski commented Oct 18, 2016

How to include 3rd party libs like ng2-translate, ng2-material and others?
After adding module to vendor.ts and build i have errors.
Inside your files i added:
vendor.ts

import {TranslateModule} from 'ng2-translate/ng2-translate';
export default {
   TranslateModule,
}

build.ts

globals:{
'ng2-translate/ng2-translate': 'vendor.TranslateModule'
}
external: [
        'ng2-translate/ng2-translate'
      ]

I fixed it
import * as _angular_translate from 'ng2-translate/ng2-translate';

default as _angular_translate,

build
globals as 'ng2-translate/ng2-translate': 'vendor._angular_translate'
and external 'ng2-translate/ng2-translate'

But I can't configure ng2-auto-complete the same way and I don't know why

with npm run serve it is working but
after this configuration I have this error with npm run roll
compile error: Error: Could not resolve '../../../src/translate.service'

@marcoturi
Copy link

To find examples on how to import 3rd party libs with rollup see here and here

@Shyam-Chen
Copy link

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

No branches or pull requests

3 participants