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

replace default export with named export CleanWebpackPlugin #138

Merged
merged 1 commit into from May 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 0 additions & 11 deletions .babelrc.js
Expand Up @@ -14,17 +14,6 @@ const babel = {
],
'@babel/preset-typescript',
],
overrides: [
{
test: ['./src/clean-webpack-plugin.ts'],
plugins: [
[
'babel-plugin-add-module-exports',
{ addDefaultProperty: true },
],
],
},
],
};

module.exports = babel;
3 changes: 0 additions & 3 deletions .eslintrc.js
Expand Up @@ -2,9 +2,6 @@

const eslint = {
extends: '@chrisblossom/eslint-config',
rules: {
'import/no-default-export': 'off',
},
overrides: [
{
files: ['dev-utils/**/*.js', 'dev-utils/**/.*.js'],
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -34,7 +34,7 @@ By default, this plugin will remove all files inside webpack's `output.path` dir
## Usage

```js
const CleanWebpackPlugin = require('clean-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');

const webpackConfig = {
plugins: [
Expand Down Expand Up @@ -126,7 +126,7 @@ new CleanWebpackPlugin({
This is a modified version of [WebPack's Plugin documentation](https://webpack.js.org/concepts/plugins/) that includes the Clean Plugin.

```js
const CleanWebpackPlugin = require('clean-webpack-plugin'); // installed via npm
const { CleanWebpackPlugin } = require('clean-webpack-plugin'); // installed via npm
const HtmlWebpackPlugin = require('html-webpack-plugin'); // installed via npm
const webpack = require('webpack'); // to access built-in plugins
const path = require('path');
Expand Down
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -58,7 +58,6 @@
"@types/node": "^12.0.2",
"@types/read-pkg-up": "^3.0.1",
"babel-jest": "^24.8.0",
"babel-plugin-add-module-exports": "^1.0.2",
"codecov": "^3.5.0",
"cross-env": "^5.2.0",
"del-cli": "^1.1.0",
Expand Down
3 changes: 2 additions & 1 deletion src/clean-webpack-plugin.test.ts
Expand Up @@ -46,7 +46,8 @@ function webpack(options: Configuration = {}) {
}

const CleanWebpackPlugin: any = function CleanWebpackPlugin(...args: any) {
const CleanWebpackPluginActual = require('./clean-webpack-plugin');
const CleanWebpackPluginActual = require('./clean-webpack-plugin')
.CleanWebpackPlugin;
const cleanWebpackPlugin = new CleanWebpackPluginActual(...args);
return cleanWebpackPlugin;
};
Expand Down
2 changes: 1 addition & 1 deletion src/clean-webpack-plugin.ts
Expand Up @@ -347,4 +347,4 @@ class CleanWebpackPlugin {
}
}

export default CleanWebpackPlugin;
export { CleanWebpackPlugin };