Skip to content

Migrate examples to type: module#4662

Merged
natemoo-re merged 6 commits into
mainfrom
chore/examples-to-module
Sep 13, 2022
Merged

Migrate examples to type: module#4662
natemoo-re merged 6 commits into
mainfrom
chore/examples-to-module

Conversation

@natemoo-re
Copy link
Copy Markdown
Member

Changes

  • Moves examples to use "type": "module" in their package.json files.
  • This aligns us with vite starters
  • This is NOT changing any behavior for existing projects, just setting new users up with the best defaults.
  • This might fix some issues with dependencies being resolved to their CJS versions in SSR while Vite resolves to their ESM version on the client...
  • Allows us to default to astro.config.js instead of the defensive astro.config.mjs

Testing

Manually

Docs

/cc @withastro/maintainers-docs for feedback!

We'd likely want to pair this change with a change to our docs to recommend astro.config.js with "type": "module" in the package.json file.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Sep 7, 2022

🦋 Changeset detected

Latest commit: ddf7c39

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@astrojs/tailwind Patch
@e2e/e2e-tailwindcss Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added the pkg: example Related to an example package (scope) label Sep 7, 2022
@natemoo-re natemoo-re requested a review from a team September 7, 2022 19:28
@natemoo-re
Copy link
Copy Markdown
Member Author

We agreed to move forward with this but rollback the change from astro.config.mjs => astro.config.js. Also going to give @delucis some time to make sure our docs are in order first!

@delucis
Copy link
Copy Markdown
Member

delucis commented Sep 9, 2022

Thanks for waiting @natemoo-re! I’ve opened withastro/docs#1514 to make the necessary docs changes.

I’d also like to change one line in the Tailwind integration README:

config: { path: './custom-config.js' },

Want to update that .js extension to .cjs as part of this PR?

@github-actions github-actions Bot added the pkg: integration Related to any renderer integration (scope) label Sep 9, 2022
Copy link
Copy Markdown
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Thanks for taking care of that docs change!

@natemoo-re natemoo-re force-pushed the chore/examples-to-module branch from ce6be71 to bc733fa Compare September 9, 2022 20:00
@natemoo-re natemoo-re merged commit 8cfb3fb into main Sep 13, 2022
@natemoo-re natemoo-re deleted the chore/examples-to-module branch September 13, 2022 19:02
@astrobot-houston astrobot-houston mentioned this pull request Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: example Related to an example package (scope) pkg: integration Related to any renderer integration (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants