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

“dist-custom-elements-bundle” only produces type definitions when there’s also a “dist” output type #2516

Closed
lxg opened this issue Jun 17, 2020 · 3 comments
Labels
ionitron: stale issue This issue has not seen any activity for a long period of time

Comments

@lxg
Copy link

lxg commented Jun 17, 2020

Stencil version:

@stencil/core@1.14.0

(partially reproducible with 1.15.0-2 as well, see below)

I'm submitting a:
[x ] bug report
[ ] feature request
[ ] support request

Current behavior:

The output target dist-custom-elements-bundle only produces type definitions when there’s also a dist output type.

For example, I have the following stencil config:

import { Config } from '@stencil/core';
import { sass } from "@stencil/sass";

export const config: Config = {
  namespace: 'elements',
  outputTargets: [
    {
      type: 'www',
      dir : 'dist/dev',
      serviceWorker: null
    },
    {
      type: 'dist',
      dir : 'dist/legacy'
    },
    {
      type: 'dist-custom-elements-bundle',
      dir : 'dist/prod'
    }
  ],
  plugins: [
    sass()
  ]
};

When I disable the type: dist entry and run stencil build, I only get a dist/prod/index.js file.

When I publish this as an NPM package and try to use it in another project, I get a “Cannot find module … or its corresponding type declarations.” error. (Note: This error does not appear in v1.15.0-2; however, the rest of this issue still exists there.)

With the type: dist entry enabled, I do get a dist/prod/index.d.ts file, but it references the types generated in the dist/legacy target.

Expected behavior:

The dist-custom-elements-bundle target should produce a self-contained package, without the dependency on another build target.

Steps to reproduce:

(See example config above)

Other information:

By the way, the info on publishing packages is empty/broken: https://stenciljs.com/docs/publishing

@simonhaenisch
Copy link
Contributor

A similar problem was fixed with #2402... maybe it is related? There's an internal dist-types output target and dist-custom-elements-bundle should also enable it but I assume it doesn't.

@simonhaenisch simonhaenisch added bug and removed triage labels Jun 18, 2020
@lxg
Copy link
Author

lxg commented Jun 18, 2020

@simonhaenisch Not sure if it is related; could well be. But if that bug is already fixed, would that be a regression? Or does it still happen because my build is happening in “prod mode”?

On a related note, is there documentation on how I can install Stencil in “source mode”, so I can poke around in the code and maybe even come up with a fix?

@ionitron-bot ionitron-bot bot added the ionitron: stale issue This issue has not seen any activity for a long period of time label Jul 18, 2020
@ionitron-bot
Copy link

ionitron-bot bot commented Jul 18, 2020

Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Stencil, please create a new issue and ensure the template is fully filled out.

Thank you for using Stencil!

@ionitron-bot ionitron-bot bot closed this as completed Jul 18, 2020
@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Jul 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ionitron: stale issue This issue has not seen any activity for a long period of time
Projects
None yet
Development

No branches or pull requests

2 participants