How to configure "lib.externals" in ng-package.json ('BusyModule' is not exported)
See original GitHub issueType of Issue
- Bug Report
- Feature Request
- Question, I guess
Description
I’m trying to create a simple angular library in which I use angular2-busy as an npm package, I import it normally and everything works when compiling my source with webpack or directly with tsc.
But I alway get the error when using ng-packagr
'BusyModule' is not exported by ..\..\node_modules\angular2-busy\index.js
the file looks like
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./build/index"));
//# sourceMappingURL=index.js.map
Since I’m fairly new to the JS-World, my question is: Can I solve this on my side or is this something ng-packagr has to solve. Or is this this something I have to bring to angular2-busy’s authors attention?
How To Reproduce
include angular2-busy as dependency and import it somewhere.
Expected Behaviour
compile it
Version Information
ng-packagr: v1.0.1
node: v8.4.0
@angular: v4.3.6
please include any version information that might be relevant, e.g. other third-party libraries
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
ng-package.json Data path ".lib" should NOT have additional ...
I am updated my npm package from angular 7.2 to angular 8.2, the problem I have now in my ng-package.json is that Property...
Read more >Build an Angular Library With NgPackagr - Fireship
Inside this the lib folder create the following elements. src/ source code; package.json package definition; public_api.ts to export your ...
Read more >ng-packagr - npm
Create one package.json per npm package, run ng-packagr for each! ... of a library are treated as external dependencies and thus are not...
Read more >Extract an Angular Module into a separate library with ng ...
They group together a set of logically connected code which can be imported and used by other modules within an Angular application.
Read more >ng-packagr/ng-package.schema.json - UNPKG
5, "description": "JSON Schema for `ng-package.json` description file", ... Read the NPM Blog on 'Package install scripts vulnerability' ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
These are the
external
andglobals
properties passed thru to rollup.Rollup says for external:
Globals is essentially the same but being used for the UMD bundle:
https://rollupjs.org/#big-list-of-options
I try to re-phrase how to set the
externals
of ng-packagr:lib.externals
is key-value pair of external dependencies of an Angular library. The key should be the import path (as used in TypeScriptimport {} from ""
statement. The value should be the module ID for the UMD bundle. In rxjs, this isRx.Classname
or theRx.Classname.prototype
. In@angular
packages, this is the token that they have configured in their build chain.Do you have externals set in
ng-package.json
?See https://github.com/dherges/ng-packagr/issues/85#issuecomment-321256775
We should have better documentation in ng-packagr for this… Oo