-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Declaration files for ESM and ES2015 builds #73
Comments
Hmm, the intention is for those to be consumed by the bundler, rather than directly. |
I guess that makes sense when importing from the root, since the package manifest will redirect the bundler to one of the builds, but in this case I want to import from a sub module. Unless I use something webpack configuration to rewrite my paths. |
Bundler configurations are the worst. There should be a import { delayUntil } from "rxjs-etc/esm2015/operators"; |
For that to work I think we would need to add a |
I just had a look at the https://github.com/cartant/rxjs-etc/blob/master/source/operators/package.json |
I've had the chance to play with it. If the following {
"name": "rxjs-etc/operators",
"main": "./index.js",
"typings": "../../operators/index.d.ts",
"sideEffects": false
} I suppose I can add those to the distributions, but, TBH, I'm also inclined to bump all of my packages by a major version and publish them as ES modules targeting es2019. I'm so over this stuff. |
IIUC, that would allow importing
Completely agree. We're using these modules on Node as well, so not sure how exactly ESM work there yet. |
Yeah, I'm inclined to agree. |
FYI, I'm giving serious consideration to exporting es2020 CommonJS via See https://nodejs.org/api/esm.html#esm_package_exports
Also https://nodejs.org/api/esm.html#esm_conditional_exports And https://medium.com/@nodejs/announcing-core-node-js-support-for-ecmascript-modules-c5d6dc29b663 |
When I try to import from
rxjs-etc/esm2015/operators/delayUntil
, I get an error:Could not find a declaration file for module 'rxjs-etc/esm2015/operators/delayUntil'
.My workaround:
Perhaps this library should enable
declaration
for the ESM and ES2015 builds, so we don't have to do this?The text was updated successfully, but these errors were encountered: