Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Next.js plugin to replace UglifyJS for BabelMinify

License

Notifications You must be signed in to change notification settings

sergiodxa/next-babel-minify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

next-babel-minify

Change UglifyJS for Babel Minify to minify the code of your application.

Next.js uses Terser now, so this plugin is not required anymore.

Installation

npm install --save next-babel-minify

or

yarn add next-babel-minify

Usage

Create a next.config.js in your project

// next.config.js
const withBabelMinify = require('next-babel-minify')()
module.exports = withBabelMinify()

Optionally you can provide Babel Minify options:

// next.config.js
const withBabelMinify = require('next-babel-minify')({
  comments: false
})
module.exports = withBabelMinify()

Optionally you can add your custom Next.js configuration as parameter

// next.config.js
const withBabelMinify = require('next-babel-minify')()
module.exports = withBabelMinify({
  webpack(config, options) {
    return config
  }
})