Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set target on webpack #12362

Closed
rafifn opened this issue Jan 13, 2023 · 1 comment
Closed

Set target on webpack #12362

rafifn opened this issue Jan 13, 2023 · 1 comment

Comments

@rafifn
Copy link

rafifn commented Jan 13, 2023

Environment

  • Operating System: Darwin
  • Node Version: v16.17.0
  • Nuxt Version: 3.0.1-rc.0-27889360.9de94c2
  • Nitro Version: 2.0.0-27889428.15edef0
  • Package Manager: npm@8.15.0
  • Builder: webpack
  • User Config: builder, hooks
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://github.com/rafifn/repro-nuxt-issue

Describe the bug

can't set the target on webpack config

Additional context

currently nuxt with vite cannot use plugin @vitejs/plugin-legacy to handle old browser, so I choose webpack as builder
and I want to set the target to es5.

Logs

For the selected environment is no default script chunk format available:                                                                                       12:11:59
JSONP Array push can be chosen when 'document' or 'importScripts' is available.
CommonJs exports can be chosen when 'require' or node builtins are available.
Select an appropriate 'target' to allow selecting one by default, or specify the 'output.chunkFormat' directly.

  JSONP Array push can be chosen when 'document' or 'importScripts' is available.
  CommonJs exports can be chosen when 'require' or node builtins are available.
  Select an appropriate 'target' to allow selecting one by default, or specify the 'output.chunkFormat' directly.
  at node_modules/webpack/lib/config/defaults.js:822:11
  at F (node_modules/webpack/lib/config/defaults.js:73:15)
  at applyOutputDefaults (node_modules/webpack/lib/config/defaults.js:803:2)
  at applyWebpackOptionsDefaults (node_modules/webpack/lib/config/defaults.js:197:2)
  at createCompiler (node_modules/webpack/lib/webpack.js:77:2)
  at create (node_modules/webpack/lib/webpack.js:134:16)
  at webpack (node_modules/webpack/lib/webpack.js:158:32)
  at f (node_modules/webpack/lib/index.js:64:16)
  at node_modules/@nuxt/webpack-builder/dist/index.mjs:1053:22
  at Array.map (<anonymous>)
  at bundle (node_modules/@nuxt/webpack-builder/dist/index.mjs:1045:36)
  at async build (node_modules/nuxt/dist/index.mjs:2282:5)
  at async Object.invoke (node_modules/nuxi/dist/chunks/build.mjs:56:5)
  at async _main (node_modules/nuxi/dist/cli.mjs:50:20)
Copy link
Member

Let's track this in #14893.

@danielroe danielroe closed this as not planned Won't fix, can't repro, duplicate, stale Jan 13, 2023
@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe transferred this issue from nuxt/framework Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants