Skip to content

Commit 5d06769

Browse files
committed
Name the export for consistent use across ESM and CJS with correct typing
1 parent 3d64d09 commit 5d06769

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ Any `devTool` (source maps) option used in Webpack is supported. This includes "
2020
Install the package from NPM and require or import it for your Webpack configuration:
2121

2222
```js
23-
const TransformAsyncModulesPlugin = require("transform-async-modules-webpack-plugin");
23+
const {
24+
TransformAsyncModulesPlugin,
25+
} = require("transform-async-modules-webpack-plugin");
2426
```
2527

2628
or
2729

2830
```js
29-
import TransformAsyncModulesPlugin from "transform-async-modules-webpack-plugin";
31+
import { TransformAsyncModulesPlugin } from "transform-async-modules-webpack-plugin";
3032
```
3133

3234
Then add an instance to the plugins array:

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "transform-async-modules-webpack-plugin",
33
"description": "A Webpack plugin to transpile async module output using Babel. Allows transpiling top level await to ES5.",
4-
"version": "1.0.1",
4+
"version": "1.0.2",
55
"license": "MIT",
66
"homepage": "https://github.com/steverep/transform-async-modules-webpack-plugin",
77
"keywords": [

src/index.cts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export type TransformAsyncModulesPluginOptions = Pick<
1010

1111
const PLUGIN_NAME = "TransformAsyncModulesPlugin " as const;
1212

13-
export default class TransformAsyncModulesPlugin {
13+
export class TransformAsyncModulesPlugin {
1414
babelOptions: TransformOptions = {};
1515

1616
constructor(options: TransformAsyncModulesPluginOptions = {}) {

0 commit comments

Comments
 (0)