Nuxt.js: When I Nuxt build, it contains ES6 code in vendors.js!

Created on 4 Aug 2020  ·  2Comments  ·  Source: nuxt/nuxt.js

Versions

  • nuxt: v2.13.0
  • node: v12.4.0

Reproduction

image


Additional Details



Steps to reproduce

in [email protected]+ is normal
Other documents are normal ,only vendors.js contains ES6.

What is Expected?

no es6

What is actually happening?

question

Most helpful comment

Update: From screenshot i guess it is query-string package thus this should do the trick:

{
  build: {
    transpile: [ 'query-string' ]
  }
}

All 2 comments

Hi @lingliMr. This is expected behavior since vendors from node_modules are ignored for babel transpile. You can whitelist the ones that need transpilation: https://nuxtjs.org/api/configuration-build/#transpile

Update: From screenshot i guess it is query-string package thus this should do the trick:

{
  build: {
    transpile: [ 'query-string' ]
  }
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

vadimsg picture vadimsg  ·  3Comments

uptownhr picture uptownhr  ·  3Comments

bimohxh picture bimohxh  ·  3Comments

o-alexandrov picture o-alexandrov  ·  3Comments

nassimbenkirane picture nassimbenkirane  ·  3Comments