-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Import Web Component from /node_modules #145
Comments
👋 Here's some code for auto-importing elements to pages: and the config: We're hoping to publish this at some point, but in the mean time I hope copy/paste will help you. I'm not sure why you're getting that JSX error, but maybe with this auto-import, it will go away |
All done! @bennypowers I believe it closely matches your configuration spec, does not break the current configuration spec, and implements your method. Any comments/corrections before I submit the pull request? See... |
🤯 wow I had only gotten as far as forking upstream :D LGTM at a glance. There's a small typo in the readme for the 'specifiers' config (wrap prop in quotes) and would you please add yourself and myself to the 'contributors' field in package.json? yeah fire away lets see what upstream thinks |
Returning to the issue at hand, I learned the solution. Will draft a "rocket theme" demonstrating use of our newly revised "eleventy-plugin-add-web-component-definitions" and the @inventage/leaflet-map web component. |
A simple npm install and rocket config now works! ...with limitations.
rocket.config.mjs: import { rocketLaunch } from '@d4kmor/launch';
import addWebComponentDefinitions from 'eleventy-plugin-add-web-component-definitions';
export default {
themes: [rocketLaunch()],
eleventy: eleventyConfig => {
eleventyConfig.addPlugin(
addWebComponentDefinitions,
{
specifiers: {
"leaflet-map": "@inventage/leaflet-map"
},
singleScript: true
}
);
}
}; docs/index.md:
The custom tag is markdown-parsed into a paragraph tag enclosure: The script import is correct, This meets my current needs. A more robust solution would ingest the custom-tag from a |
nice work @gdbaldw on that PR I've also got that working on my site, but it does require |
@bennypowers Thanks. I expect there no practical benefit to using the src attribute in development. And with rocket, I believe rollup bundles and outputs scripts as a src attribute during production build. |
Documentation shows:
Added...
> yarn workspace @d4kmor/launch add @inventage/leaflet-map
Then in-lined...
That works!
But then in-lined...
SyntaxError: Support for the experimental syntax 'jsx' isn't currently enabled
Sorry, I'm ahead of development. Will be nice.
The text was updated successfully, but these errors were encountered: