Skip to content

Commit

Permalink
fix(build): allow data-loaders files in packages to be found (closes #…
Browse files Browse the repository at this point in the history
…2272)

Co-authored-by: John Campion Jr <john@brightshore.com>
  • Loading branch information
brc-dd and JohnCampionJr committed Apr 24, 2023
1 parent f744364 commit 84cf457
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/node/plugins/staticDataPlugin.ts
Expand Up @@ -8,7 +8,7 @@ import path, { dirname, resolve } from 'path'
import { isMatch } from 'micromatch'
import glob from 'fast-glob'

const loaderMatch = /\.data\.(j|t)s$/
const loaderMatch = /\.data\.(j|t)s($|\?)/

let server: ViteDevServer

Expand Down Expand Up @@ -71,7 +71,7 @@ export const staticDataPlugin: Plugin = {
} else {
// use vite's load config util as a away to load Node.js file with
// TS & native ESM support
const res = await loadConfigFromFile({} as any, id)
const res = await loadConfigFromFile({} as any, id.replace(/\?.*$/, ''))

// record deps for hmr
if (server && res) {
Expand Down

0 comments on commit 84cf457

Please sign in to comment.