Skip to content

Commit

Permalink
change default export to named export
Browse files Browse the repository at this point in the history
  • Loading branch information
guoyunhe committed Feb 12, 2023
1 parent b203f51 commit acfd564
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.0.0 - 2023-02-12

- **BREAKING CHANGE**: Changed default export to named export

## 1.1.1 - 2023-02-11

- Fixed readme
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Recommended configuration:

```js
// webpack.config.js
const SwcMinifyWebpackPlugin = require('swc-minify-webpack-plugin');
const { SwcMinifyWebpackPlugin } = require('swc-minify-webpack-plugin');

module.exports = {
optimization: {
Expand All @@ -36,7 +36,7 @@ Custom configuration:

```js
// webpack.config.js
const SwcMinifyWebpackPlugin = require('swc-minify-webpack-plugin');
const { SwcMinifyWebpackPlugin } = require('swc-minify-webpack-plugin');

module.exports = {
optimization: {
Expand Down
2 changes: 1 addition & 1 deletion example/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const SwcMinifyWebpackPlugin = require('../dist');
const { SwcMinifyWebpackPlugin } = require('../dist');

module.exports = {
mode: 'production',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "swc-minify-webpack-plugin",
"version": "1.1.2",
"version": "2.0.0",
"description": "A faster minimizer for webpack based on swc.minify()",
"keywords": [
"webpack",
Expand Down
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { RawSource, SourceMapSource } = webpack.sources;

const isJsFile = /\.[cm]?js(\?.*)?$/i;

class SwcMinifyWebpackPlugin {
export class SwcMinifyWebpackPlugin {
private readonly options: JsMinifyOptions = {
compress: true,
mangle: true,
Expand Down Expand Up @@ -101,4 +101,3 @@ class SwcMinifyWebpackPlugin {
);
}
}
export = SwcMinifyWebpackPlugin;

0 comments on commit acfd564

Please sign in to comment.