mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 01:15:58 +00:00
fix(webpack): import esbuild-loader
as commonjs (#2460)
This commit is contained in:
parent
85f0547ca4
commit
c288907f72
@ -1,4 +1,4 @@
|
|||||||
import { ESBuildMinifyPlugin } from 'esbuild-loader'
|
import esbuildLoader from 'esbuild-loader'
|
||||||
import { WebpackConfigContext } from '../utils/config'
|
import { WebpackConfigContext } from '../utils/config'
|
||||||
|
|
||||||
export function esbuild (ctx: WebpackConfigContext) {
|
export function esbuild (ctx: WebpackConfigContext) {
|
||||||
@ -9,7 +9,8 @@ export function esbuild (ctx: WebpackConfigContext) {
|
|||||||
// https://nodejs.org/en/
|
// https://nodejs.org/en/
|
||||||
const target = ctx.isServer ? 'es2019' : 'chrome85'
|
const target = ctx.isServer ? 'es2019' : 'chrome85'
|
||||||
|
|
||||||
config.optimization.minimizer.push(new ESBuildMinifyPlugin())
|
// https://github.com/nuxt/framework/issues/2372
|
||||||
|
config.optimization.minimizer.push(new (esbuildLoader as unknown as typeof import('esbuild-loader')).ESBuildMinifyPlugin())
|
||||||
|
|
||||||
config.module.rules.push(
|
config.module.rules.push(
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user