Skip to content

Commit 1627dff

Browse files
committed
fix: suppress webpack critical dependency warnings
- Add webpackIgnore magic comments to dynamic imports in config-loader.ts - Fixes webpack warnings about critical dependencies in Next.js builds - Version bump to 0.13.1
1 parent 1acd42d commit 1627dff

2 files changed

Lines changed: 21 additions & 5 deletions

File tree

apps/drizzleasy/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@remcostoeten/drizzleasy",
3-
"version": "0.13.0",
3+
"version": "0.13.1",
44
"description": "Ultra-simple, type-safe CRUD operations for Next.js with Drizzle ORM",
55
"type": "module",
66
"main": "dist/index.js",

apps/drizzleasy/src/database/config-loader.ts

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,11 @@ async function safeImport(modulePath: string): Promise<any> {
149149
const normalizedPath = modulePath.replace(/\\/g, '/')
150150

151151
// Try dynamic import first (ES modules)
152-
const module = await import(/* @vite-ignore */ normalizedPath)
152+
const module = await import(
153+
/* webpackIgnore: true */
154+
/* @vite-ignore */
155+
normalizedPath
156+
)
153157
return module
154158
} catch (error) {
155159
// Enhanced error logging for debugging
@@ -183,17 +187,29 @@ async function safeImportForNextJS(modulePath: string): Promise<any> {
183187

184188
// First attempt: relative path import
185189
try {
186-
const module = await import(/* @vite-ignore */ relativePath)
190+
const module = await import(
191+
/* webpackIgnore: true */
192+
/* @vite-ignore */
193+
relativePath
194+
)
187195
return module
188196
} catch (relativeError) {
189197
// Second attempt: absolute path with file:// protocol
190198
try {
191199
const fileUrl = `file://${modulePath}`
192-
const module = await import(/* @vite-ignore */ fileUrl)
200+
const module = await import(
201+
/* webpackIgnore: true */
202+
/* @vite-ignore */
203+
fileUrl
204+
)
193205
return module
194206
} catch (fileUrlError) {
195207
// Third attempt: standard absolute path
196-
const module = await import(/* @vite-ignore */ modulePath)
208+
const module = await import(
209+
/* webpackIgnore: true */
210+
/* @vite-ignore */
211+
modulePath
212+
)
197213
return module
198214
}
199215
}

0 commit comments

Comments
 (0)