Skip to content

Conversation

@jamesopstad
Copy link
Contributor

@jamesopstad jamesopstad commented Dec 22, 2025

Fixes #9011

Add default Text module rule for .sql files.

This enables importing .sql files directly in Wrangler and the Cloudflare Vite plugin without extra configuration.

Note: this will remove the need to add a custom rule here so I will open a PR to update the Drizzle docs once this is released.


A picture of a cute animal (not mandatory, but encouraged)

@changeset-bot
Copy link

changeset-bot bot commented Dec 22, 2025

🦋 Changeset detected

Latest commit: 2998908

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

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

@claude
Copy link
Contributor

claude bot commented Dec 22, 2025

Claude finished @jamesopstad's task —— View job


Changeset Review

  • Read changeset guidelines
  • Review changeset file
  • Check for cute animal image
  • Validate and provide feedback

⚠️ Issues found

The changeset needs improvement in the following area:

Changelog Quality: The changeset description should include a usage example for this new feature. According to the guidelines, "For new features or significant changes, include a brief usage example. This helps users understand how to use the new functionality."

Consider adding an example like:

Add default `Text` module rule for `.sql` files

This enables importing `.sql` files directly in Wrangler and the Cloudflare Vite plugin without extra configuration.

You can now import SQL files directly:

```ts
import schema from './schema.sql';
console.log(schema); // SQL file contents as a string
```

Previously, this required adding a custom module rule in your configuration.

What's correct:
✅ Version type: minor is appropriate for this new feature
✅ Both affected packages are listed (@cloudflare/vite-plugin and wrangler)
✅ No forbidden markdown headers (h1/h2/h3)
✅ No major version bump for wrangler

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 22, 2025

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@11738

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@11738

miniflare

npm i https://pkg.pr.new/miniflare@11738

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@11738

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@11738

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@11738

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@11738

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@11738

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@11738

wrangler

npm i https://pkg.pr.new/wrangler@11738

commit: 2998908

@jamesopstad jamesopstad force-pushed the james/sql-default-rule branch from 3957d47 to 2998908 Compare December 22, 2025 17:11
@jamesopstad jamesopstad marked this pull request as ready for review December 22, 2025 17:12
@jamesopstad jamesopstad requested a review from a team as a code owner December 22, 2025 17:12
@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Dec 22, 2025
@jamesopstad jamesopstad merged commit c54f8da into main Dec 22, 2025
37 of 38 checks passed
@jamesopstad jamesopstad deleted the james/sql-default-rule branch December 22, 2025 19:15
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Dec 22, 2025
AmirSa12 pushed a commit to AmirSa12/workers-sdk that referenced this pull request Jan 5, 2026
* Add failing fixture

* Add default SQL rule to Wrangler

* Add failing Vite playground test

* Add default SQL rule to Vite plugin

* Add changeset

* Update snapshot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

vite-plugin: Fails to import sql files

4 participants