Skip to content

refactor: use try-catch with dynamic imports so that they can be replaced easily by bundlers#262

Merged
ai merged 1 commit intopostcss:mainfrom
brc-dd:replaceable-dynamic-import
Jun 2, 2024
Merged

refactor: use try-catch with dynamic imports so that they can be replaced easily by bundlers#262
ai merged 1 commit intopostcss:mainfrom
brc-dd:replaceable-dynamic-import

Conversation

@brc-dd
Copy link
Copy Markdown
Contributor

@brc-dd brc-dd commented Jun 2, 2024

Notable Changes

Commit Message Summary (CHANGELOG)

make it easy to replace dynamic imports for tools bundling this module

Type

  • CI
  • Fix
  • Perf
  • Docs
  • Test
  • Chore
  • Style
  • Build
  • Feature
  • Refactor

SemVer

  • Fix (:label: Patch)
  • Feature (:label: Minor)
  • Breaking Change (:label: Major)

Issues

This was adjusted in #260. Needed for vite because without replacement rollup bundles tsx and jiti. yaml import is already correct.

Checklist

  • Lint and unit tests pass with my changes
  • I have added tests that prove my fix is effective/works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes are merged and published in downstream modules

Comment thread tsconfig.json
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"module": "Preserve",
Copy link
Copy Markdown
Contributor Author

@brc-dd brc-dd Jun 2, 2024

Choose a reason for hiding this comment

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

not sure why was this Preserve, but Preserve is not a valid value for module

@brc-dd brc-dd changed the title fix: use try-catch with dynamic imports so that they can be replaced with require by bundlers refactor: use try-catch with dynamic imports so that they can be replaced easily by bundlers Jun 2, 2024
@ai ai merged commit 1c2e382 into postcss:main Jun 2, 2024
@ai
Copy link
Copy Markdown
Member

ai commented Jun 2, 2024

Thanks. Released in 6.0.1.

@brc-dd brc-dd deleted the replaceable-dynamic-import branch June 2, 2024 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants