We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0284d09 commit b789fbeCopy full SHA for b789fbe
src/esbuildImportMetaUrlPlugin.ts
@@ -7,7 +7,7 @@ export default <Plugin>{
7
name: 'import.meta.url',
8
setup ({ onLoad }) {
9
// Help vite that bundles/move files in dev mode without touching `import.meta.url` which breaks asset urls
10
- onLoad({ filter: /.*\.js/, namespace: 'file' }, async args => {
+ onLoad({ filter: /.*\.js$/, namespace: 'file' }, async args => {
11
const code = fs.readFileSync(args.path, 'utf8')
12
13
const assetImportMetaUrlRE = /\bnew\s+URL\s*\(\s*('[^']+'|"[^"]+"|`[^`]+`)\s*,\s*import\.meta\.url\s*(?:,\s*)?\)/g
0 commit comments