Skip to content
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

feat: new cjs and esm bundles for core #2893

Merged
merged 4 commits into from
Jul 16, 2023
Merged

Conversation

barak007
Copy link
Collaborator

@barak007 barak007 commented Jul 15, 2023

This PR adds two bundles to the dist of @stylable/core.

  • stylable.lib.cjs - to be able to run in playground with commonjs module system
  • stylable.lib.esm - to be able to run in browsers via import

I didn't add the files anywhere in the package json just emitting the files to dist. also didn't output global iife bundle.

I removed from enhanced-resolve and made it mandatory to pass resolveModule to Stylable (only in the bundle). We want to remove the default resolver anyhow in the next major.
I also moved stylable-js-module-source to core since it's the missing peace to a full transform of Stylable modules without any other packages.

This adds mothing to the build time for both bundles.
we might want to consider running the entire build with esbuild.

@barak007 barak007 requested a review from idoros July 15, 2023 18:27
Copy link
Collaborator

@idoros idoros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't add the files anywhere in the package json just emitting the files to dist. also didn't output global iife bundle.

maybe open an issue for the next major to collect the external API we want to expose in exports

packages/module-utils/src/index.ts Show resolved Hide resolved
scripts/build.js Show resolved Hide resolved
scripts/build.js Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@idoros idoros added feature New syntax feature or behavior API Programmatic API labels Jul 16, 2023
@barak007 barak007 merged commit b4a4296 into master Jul 16, 2023
18 checks passed
@barak007 barak007 deleted the barak/core-esm-bundle branch July 16, 2023 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Programmatic API feature New syntax feature or behavior
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

None yet

2 participants