Skip to content

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

Closed

Description

@lxg

Stencil version:

(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

Activity

  1. simonhaenisch commented on Jun 18, 2020

    @simonhaenisch
    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.

  2. lxg commented on Jun 18, 2020

    @lxg
    Author

    @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?

  3. added
    ionitron: stale issue
    on Jul 18, 2020
  4. ionitron-bot commented on Jul 18, 2020

    @ionitron-bot

    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!

  5. locked and limited conversation to collaborators on Jul 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ionitron: stale issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions