Skip to content

Using a StencilJS output in another StencilJS project #6641

@ThornWalli

Description

@ThornWalli

Prerequisites

Describe the Feature Request

From a other StencilJS package, types, mixins, etc. can be imported using import.

Describe the Use Case

There is a core package, which is a StencilJS project containing basic components (button, table, …) and utilities.

In another StencilJS project, the type definitions, basic components, and utilities should be imported from the core package.

Currently, everything is provided in the collection folder within the dist directory of the core package.

This means that, in theory, a type definition or mixin can be imported.

import { defaultFactory } from ‘project/core/collection/mixins/default’;

import { HTMLDefaultElement } from ‘@boilerplate-stencil/core/dist/types’;

Problem
When an import is used (whether a type definition or a mixin), the core package is directly incorporated into the rest of the project, meaning components become known and are included in the build.
However, it may be that only a type definition was imported.

Describe Preferred Solution

It feels like tree shaking is missing here?

Describe Alternatives

No response

Related Code

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stencil v5This is slated for Stencil v5 (Release date TBD)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions