-
Notifications
You must be signed in to change notification settings - Fork 295
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
Instructions for overriding tsconfig.json don't seem to work #2156
Comments
Hi @alan-agius4 , I was wondering if you have any tips for updating a library to Angular 13 that needs |
What you can do is instead of extending the tsconfig you copy the options directly in your project.
|
Thanks! When I try those options, I get
|
I updated the tsconfig above, can you please try again? |
That seems a lot better, thanks :) |
Hi @alan-agius4, after using your updated tsconfig I was able to publish my library. However, I have a new problem for downstream apps and I'm not sure if it's due to a related bug, or something else entirely. The library itself (whose code I am unfortunately unable to share) consists of multiple secondary entrypoints. One of these entrypoints uses a default import of a private dependency of the app, (library source code)
The library itself also includes a demo project. If I run (library demo app compiled output)
Now, when I distribute the library and import it in my downstream app, I can see the following in the library's (library APF compiled output)
Everything up to now looks fine to me. However when I
If I look at the build output for the app, I see this: (downstream app compiled output)
The problem seems to be that the CLI/Webpack is not adding the Do you know if this is a configuration issue? Thanks for your help. === Update: since I control |
The name The import moment from 'moment-mini-es6'; The catch is that the above will only work if it is downlevelled to CJS and can never work in full ESM scenario. var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const moment_mini_es6_1 = __importDefault(require("moment-mini-es6"));
console.log(moment_mini_es6_1.default); You can also try this quite easily in Node, without any bundler involved. test.mjs import m from 'moment-mini-es6';
console.log(m); Run the above script
|
Thanks a lot - that library was a shim I had to add a long time ago, but removing it and just calling the underlying |
Type of Issue
Description
A bug: please describe the error that you encountered
I encountered some issues when trying to upgrade my 12.x project (which overrides some tsconfig options) to 13.x. I was unable to find a working solution for overriding some tsconfig options. I could reproduce the issue on a fresh minimal reproduction.
A feature: please describe your use case and motivation
How To Reproduce
A bug: please include instructions how to reproduce. Issues without reproduction are likely to receive no feedback.
public_api.ts
at root with contentsexport const FOO = 'bar';
package.json
to addng-packagr
build script:confirm that the project builds successfully by running
npm build
add custom
tsconfig.lib.json
per these instructions, with contentspoint ngpackagr to this config in the build script:
"build": "ng-packagr -p package.json --config tsconfig.lib.json"
run
npm build
and get error message:Can you reproduce the error in the integration tests in ng-packagr?
If possible, take a look at the
integration/samples
and try to break one of these builds!Is the error you faced in an application importing the library
Try to break the Angular CLI app in
integration/consumers/ng-cli
!Expected Behaviour
A bug: please describe what behaviour or result you expected
It should compile
A feature: do you have a first draft or an idea how to implement?
Version Information
Windows 10
Please include all version numbers that might be relevant, e.g. third-party libraries
The text was updated successfully, but these errors were encountered: