-
Notifications
You must be signed in to change notification settings - Fork 9
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
CommonJS distribution bundle #67
Conversation
@@ -4,8 +4,7 @@ import './dom-shim.js'; | |||
import * as acorn from 'acorn'; | |||
import * as walk from 'acorn-walk'; | |||
import { parse, parseFragment, serialize } from 'parse5'; | |||
|
|||
import fs from 'node:fs/promises'; | |||
import fs from 'fs/promises'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropped node:
for better backwards support for now, of Node >= 14.x
@@ -105,10 +104,11 @@ async function getTagName(moduleURL) { | |||
async function initializeCustomElement(elementURL, tagName, attrs = []) { | |||
await registerDependencies(elementURL); | |||
|
|||
const { pathname } = elementURL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoiding direct use of import(elementURL)
since when converted to CJS, require
will break when given a URL
.
If 11ty moves to ESM, then we could remove this, but might be nice for general CJS <> ESM interop.
Related Issue
In support of integrating with CJS based projects like Eleventy, using Rollup to provide a temporary "dist" version of WCC for projects that can't support ESM directly.
Summary of Changes
dist
command to generate a single bundle ofwcc
prepublish
script to make sure it gets run on each publish