mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 15:15:19 +00:00
feat(webpack): allow configuring esbuild-loader
options (#21436)
This commit is contained in:
parent
f0ade90645
commit
525a06af38
@ -43,6 +43,7 @@ export default defineBuildConfig({
|
|||||||
'consola',
|
'consola',
|
||||||
'ignore',
|
'ignore',
|
||||||
'vue-loader',
|
'vue-loader',
|
||||||
|
'esbuild-loader',
|
||||||
// Implicit
|
// Implicit
|
||||||
'@vue/compiler-core',
|
'@vue/compiler-core',
|
||||||
'@vue/shared',
|
'@vue/shared',
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
"@unhead/schema": "1.1.27",
|
"@unhead/schema": "1.1.27",
|
||||||
"@vitejs/plugin-vue": "4.2.3",
|
"@vitejs/plugin-vue": "4.2.3",
|
||||||
"@vitejs/plugin-vue-jsx": "3.0.1",
|
"@vitejs/plugin-vue-jsx": "3.0.1",
|
||||||
|
"esbuild-loader": "^3.0.1",
|
||||||
"h3": "1.6.6",
|
"h3": "1.6.6",
|
||||||
"ignore": "5.2.4",
|
"ignore": "5.2.4",
|
||||||
"nitropack": "2.4.1",
|
"nitropack": "2.4.1",
|
||||||
|
@ -147,6 +147,8 @@ export default defineUntypedSchema({
|
|||||||
}
|
}
|
||||||
return val
|
return val
|
||||||
},
|
},
|
||||||
|
/** @type {typeof import('esbuild-loader')['LoaderOptions']} */
|
||||||
|
esbuild: {},
|
||||||
file: { esModule: false },
|
file: { esModule: false },
|
||||||
fontUrl: { esModule: false, limit: 1000 },
|
fontUrl: { esModule: false, limit: 1000 },
|
||||||
imgUrl: { esModule: false, limit: 1000 },
|
imgUrl: { esModule: false, limit: 1000 },
|
||||||
|
@ -27,16 +27,18 @@ export function esbuild (ctx: WebpackConfigContext) {
|
|||||||
fullySpecified: false
|
fullySpecified: false
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
loader: 'ts',
|
target,
|
||||||
target
|
...ctx.nuxt.options.webpack.loaders.esbuild,
|
||||||
|
loader: 'ts'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.m?[jt]sx$/,
|
test: /\.m?[jt]sx$/,
|
||||||
loader: 'esbuild-loader',
|
loader: 'esbuild-loader',
|
||||||
options: {
|
options: {
|
||||||
loader: 'tsx',
|
target,
|
||||||
target
|
...ctx.nuxt.options.webpack.loaders.esbuild,
|
||||||
|
loader: 'tsx'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -543,6 +543,9 @@ importers:
|
|||||||
'@vitejs/plugin-vue-jsx':
|
'@vitejs/plugin-vue-jsx':
|
||||||
specifier: 3.0.1
|
specifier: 3.0.1
|
||||||
version: 3.0.1(vite@4.3.9)(vue@3.3.4)
|
version: 3.0.1(vite@4.3.9)(vue@3.3.4)
|
||||||
|
esbuild-loader:
|
||||||
|
specifier: ^3.0.1
|
||||||
|
version: 3.0.1(webpack@5.85.1)
|
||||||
h3:
|
h3:
|
||||||
specifier: 1.6.6
|
specifier: 1.6.6
|
||||||
version: 1.6.6
|
version: 1.6.6
|
||||||
@ -3106,7 +3109,6 @@ packages:
|
|||||||
|
|
||||||
/big.js@5.2.2:
|
/big.js@5.2.2:
|
||||||
resolution: {integrity: sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==}
|
resolution: {integrity: sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==}
|
||||||
dev: false
|
|
||||||
|
|
||||||
/binary-extensions@2.2.0:
|
/binary-extensions@2.2.0:
|
||||||
resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==}
|
resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==}
|
||||||
@ -3971,7 +3973,6 @@ packages:
|
|||||||
/emojis-list@3.0.0:
|
/emojis-list@3.0.0:
|
||||||
resolution: {integrity: sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==}
|
resolution: {integrity: sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==}
|
||||||
engines: {node: '>= 4'}
|
engines: {node: '>= 4'}
|
||||||
dev: false
|
|
||||||
|
|
||||||
/encodeurl@1.0.2:
|
/encodeurl@1.0.2:
|
||||||
resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==}
|
resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==}
|
||||||
@ -4102,7 +4103,6 @@ packages:
|
|||||||
loader-utils: 2.0.4
|
loader-utils: 2.0.4
|
||||||
webpack: 5.85.1
|
webpack: 5.85.1
|
||||||
webpack-sources: 1.4.3
|
webpack-sources: 1.4.3
|
||||||
dev: false
|
|
||||||
|
|
||||||
/esbuild@0.17.19:
|
/esbuild@0.17.19:
|
||||||
resolution: {integrity: sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==}
|
resolution: {integrity: sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==}
|
||||||
@ -5769,7 +5769,6 @@ packages:
|
|||||||
big.js: 5.2.2
|
big.js: 5.2.2
|
||||||
emojis-list: 3.0.0
|
emojis-list: 3.0.0
|
||||||
json5: 2.2.3
|
json5: 2.2.3
|
||||||
dev: false
|
|
||||||
|
|
||||||
/local-pkg@0.4.3:
|
/local-pkg@0.4.3:
|
||||||
resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==}
|
resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==}
|
||||||
@ -7479,7 +7478,6 @@ packages:
|
|||||||
|
|
||||||
/source-list-map@2.0.1:
|
/source-list-map@2.0.1:
|
||||||
resolution: {integrity: sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==}
|
resolution: {integrity: sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==}
|
||||||
dev: false
|
|
||||||
|
|
||||||
/source-map-js@1.0.2:
|
/source-map-js@1.0.2:
|
||||||
resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==}
|
resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==}
|
||||||
@ -8565,7 +8563,6 @@ packages:
|
|||||||
dependencies:
|
dependencies:
|
||||||
source-list-map: 2.0.1
|
source-list-map: 2.0.1
|
||||||
source-map: 0.6.1
|
source-map: 0.6.1
|
||||||
dev: false
|
|
||||||
|
|
||||||
/webpack-sources@3.2.3:
|
/webpack-sources@3.2.3:
|
||||||
resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==}
|
resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==}
|
||||||
|
Loading…
Reference in New Issue
Block a user