Skip to content

Instantly share code, notes, and snippets.

@okmttdhr
Created November 12, 2018 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save okmttdhr/f1d8f06b4eb315da99e8491f4d4cf5de to your computer and use it in GitHub Desktop.
Save okmttdhr/f1d8f06b4eb315da99e8491f4d4cf5de to your computer and use it in GitHub Desktop.
Disable uglify with nuxt.config.js

Babel

https://github.com/nuxt/nuxt.js/blob/master/lib/builder/builder.js#L198

{
  // ...
  build: {
    extend (config, { isDev, isClient }) {
      console.log(config.externals = [])
      config.module.rules = [...config.module.rules.map((r) => {
        if (r.loader !== 'babel-loader') {
          return r
        }
        r.options.presets[0][1]['targets']['uglify'] = false
        return r
      })]
    }
  }
}

Plugin

https://github.com/nuxt/nuxt.js/blob/master/lib/builder/webpack/client.config.js#L184

{
  // ...
  build: {
    uglify: {
      uglifyOptions: {
        compress: false
      },
    },
  }
}

or

{
  // ...
  build: {
    uglify: false,
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment