Closed sslotsky closed 4 years ago
I didn't realize you were using Stencil when I tweeted you last night. The instructions are a bit different in this case.
Stencil is aware of the library because of the collection
properties in package.json
:
"collection": "dist/collection/collection-manifest.json",
"collection:main": "dist/collection/index.js",
This provides Stencil with some first-class insight into the package, so you can import the library like this:
import '@shoelace-style/shoelace';
And then just attach the supporting stylesheet to supply design tokens from:
@shoelace-style/shoelace/dist/shoelace/shoelace.css
Doing this, assets are loading as expected (icon is the only component that uses icons right now):
That said, I'm not sure why that import is failing, but I've tested it to work in webpack and Rollup independently and it works outside the context of a Stencil app.
Success!!! Thank you :bow:
Describe the bug
Using 2.0.0-beta.15
Following the instructions for important components from a Rollup app, I'm unable to build my Stencil project as soon as I attempt to import
setAssetPath
.Inspecting the file
node_modules/@shoelace-style/shoelace/dist/collection/index.js
reveals that it's completely empty. On the other hand,setAssetPath
does seem to be exported formnode_modules/@shoelace-style/shoelace/dist/custom-elements/index.js
. So perhaps something is just off with the build configuration for Shoelace.To Reproduce
From another Stencil project:
setAsset
path as shown in the docsMissing Export
errorExpected behavior
The compiler should be able to resolve imports into shoelace and build successfully.
Snippets
Stencil config:
Sample component: