question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

declare some third party variable like 'moment' in typing.d.ts, and run build library also throw: Cannot find name 'moment'

See original GitHub issue

Type of Issue

[ x] Bug Report
[ ] Feature Request

Description

declare some third party variable like ‘moment’ in typing.d.ts, and run build library also throw: Cannot find name ‘moment’

How To Reproduce

Expected Behaviour

how can i config this third party variable to build libary

Version Information

$ node_modules/.bin/ng-packagr --version
ng-packagr:            5.3.0
@angular/compiler:     8.0.2
rollup:                1.16.2
tsickle:               0.35.0
typescript:            3.4.5

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
raphael22commented, Sep 4, 2019

Welcome to my world of 1+ year of “nobody care”. https://github.com/ng-packagr/ng-packagr/issues/744

3reactions
raphael22commented, Sep 6, 2019

Hi, thanks for quick response.

It’s a matter of taking both benefit of peerDependencies and dependencies in a production context.

As an Angular deployed applications hub, I want to be able to import plugins angular applications. I don’t want them to copies peerDependencies, but I do want them to come with there own dependencies I don’t have already.

I want to be able to develop a new plugin application without having to reference it’s dependencies in my hub application and without to redeploy.

A nice final umd file which can be consume by another ALREADY built angular application. I can already achieve this with extra steps by installing dependencies in dist folder and using browserify on top on that but I guess it’s could be done by some rollup step on build.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Moment.js + TypeScript. Cannot find name moment
Now i try to use moment.js. Like with knockout: install, include d.ts, include script to page and i get an error cannot find...
Read more >
Typescript Typings: The Complete Guide: @types Compiler ...
Typescript Typings - The Complete Guide To Type Definitions: @types, Compiler Opt-In Types: When To Use Each and Why?
Read more >
Changelog - Cypress Documentation
Fixes #24611; Fixed an 11.0.0 regression where using custom reporters would cause Cypress to throw a 'Cannot find module' error.
Read more >
rollup.js
Rollup is a module bundler for JavaScript which compiles small pieces of code into something larger and more complex, such as a library...
Read more >
Docs - Moment.js
This option can be used to take the internal UTC-based timestamp of a Date object and get a string that has been converted...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found