-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
import.meta not support in esbuild-loader(target: es2017) evanw/esbuild#349
I hack this issue by moving import.meta.webpackContext to js files, like
// utils/webpack-env
// refs: https://webpack.js.org/api/module-variables/#importmetawebpackcontext
export const contextRequire = import.meta.webpackContext('..', {
recursive: true,
regExp: /.tsx/,
mode: 'sync',
})then use it in App.tsx
import { contextRequire } from '@/utils/webpack-env'
console.log(contextRequire('./pages/index.tsx'))or try supports options recommended in evanw/esbuild#349 (comment)
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers