🌜
ğŸŒž
@webpack-blocks/uglify

@webpack-blocks/uglify

v2.1.0

Webpack block for UglifyJS

npm install @webpack-blocks/uglify

README

webpack-blocks - UglifyJS

Gitter chat NPM Version

This block provides UglifyJS webpack plugin configuration for webpack-blocks.

Based on uglifyjs-webpack-plugin (not webpack.optimize.UglifyJsPlugin) which uses UglifyJS v3 (uglify-es) that supports ECMAScript 2015.

This block will only work in the production mode.

Usage

const { createConfig, env, uglify } = require('webpack-blocks')

module.exports = createConfig([
  uglify(/* options */)
])

Options

You can pass any uglifyjs-webpack-plugin and UglifyJS options, see the uglifyjs-webpack-plugin docs for details.

Generated webpack config

By default generates this configuration:

{
  optimization: {
    minimizer: [
      new UglifyJSPlugin({
        parallel: true,
        cache: true,
        uglifyOptions: {
          compress: {
            warnings: false
          }
        }
      })
    ]
  }
}

webpack-blocks

Check out the

👉 Main documentation

Released under the terms of the MIT license.

Release Notes

2.1.0
By Andy Wermke • Published on April 27, 2020

Just a small maintenance release bumping dependencies. Thanks a lot, @marcofugaro! 😊

Attention: Minimum node.js version is hereby raised from node 8 to node 10.

1.0.0
By Andy Wermke • Published on August 29, 2017

📦 Version 1.0 - finally!

Here we go, version 1.0. A lot has happened and I think I speak for all of us when I say we could easily have made two major version bumps out of that one 😉

Changes since v1.0 release candidate

Support negations in match() glob patterns (#253)

You can now have exclusion patterns without writing ugly regular expressions!

match(['*.js', '*.jsx', '!node_modules'], [
  babel()
])

Allow passing arbitrary rule options via match() (#250)

There was an undocumented limitation before when passing custom webpack rule options via match(): You could only pass include and exclude. This has been fixed now.

You can now pass any kind of option if necessary (note the enforce: 'pre'):

match('*.{js,jsx}', { exclude: 'node_modules', enforce: 'pre' }, [
  babel()
])

Added when() (#243)

There is a new helper on the block: when(). It's a pinch of syntactic sugar for conditionals, so your config won't be cluttered with ternary operators.

module.exports = createConfig([
  when(process.env.CI, [reportBuildStatsPlugin()])
])

New block eslint (#254)

There is now an eslint block and it's even part of the core packages.

const { createConfig } = require('@webpack-blocks/webpack')
const eslint = require('@webpack-blocks/eslint')

module.exports = createConfig([
  eslint(/* eslint options */)
])

Removed proxy() from dev-server block (#251)

We trimmed down the dev-server block a little more. But don't worry, it's still easy as cake to set up a proxy server using the dev-server block:

module.exports = createConfig([
  // use only if `NODE_ENV === 'development'`:
  env('development', [
    devServer({
      proxy: {
        '/api': { target: 'http://localhost:3000' },
      },
    }),
  ])
])

Changes since v1.0 beta

Have a look at the v1.0.0-rc release notes.

Changes since v0.4

Have a look at the v1.0.0-beta release notes and read the migration guide.


This is it. A big shout out to the contributors!

Especially @vlad-zhukov, @marcofugaro, @boxfoot, @dmitmel and @sapegin this time 😊

General

License
MIT
Typescript Types
Tree-shakeable
No

Popularity

GitHub Stargazers
2,983
Community Interest
3,164
Number of Forks
115

Maintenance

Commits
11/2110/2203
Last Commit
Open Issues
16
Closed Issues
95
Open Pull Requests
3
Closed Pull Requests
29

Versions

Versions Released
11/2110/2201
Latest Version Released
Apr 27, 2020
Current Tags
latest2.1.0
next2.0.0-alpha

Dependencies

Contributors

andywer
andywer
Commits: 57
sapegin
sapegin
Commits: 32
jvanbruegge
jvanbruegge
Commits: 18
eXon
eXon
Commits: 14
aaronjensen
aaronjensen
Commits: 13
marcofugaro
marcofugaro
Commits: 13
dmitmel
dmitmel
Commits: 10
smdern
smdern
Commits: 9
timdeschryver
timdeschryver
Commits: 9
diegohaz
diegohaz
Commits: 5
jeetiss
jeetiss
Commits: 5
vlad-zhukov
vlad-zhukov
Commits: 4
langovoi
langovoi
Commits: 4
zcei
zcei
Commits: 2
amilajack
amilajack
Commits: 2