ionic-team / stencil-component-starter

Minimal starter project for building shareable web components with Stencil
https://github.com/ionic-team/stencil
MIT License
278 stars 128 forks source link

fix(exports): add explicit loader export mapping #137

Closed rwaskiewicz closed 5 months ago

rwaskiewicz commented 5 months ago

this commit adds an export mapping to the loader package to package.json.

prior to this commit, users working their way through stencil's guide for setting up the react output target would run into an error when trying to spin up a react app with vite:

vite v5.2.9 building for production...
✓ 7 modules transformed.
x Build failed in 31ms
error during build:
Error: [commonjs--resolver] Missing "./loader" specifier in "stencil-library" package
     <STACK_TRACE_OMITTED>

npm ERR! Lifecycle script `build` failed with error:
npm ERR! Error: command failed
npm ERR!   in workspace: my-app@0.0.0
npm ERR!   at location: /private/tmp/react-set-asset-path/packages/my-app

this restores the behavior previously supported in https://github.com/ionic-team/stencil-component-starter/pull/134, without requiring us to rewrite the react guide