Skip to content

Commit f659276

Browse files
committed
Use CJS insteam of ESM
It makes more sense for now.
1 parent 7a32a61 commit f659276

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Add the plugin to your webpack config.
1919

2020
```js
2121
// webpack.config.js
22-
const hooksScriptPlugin = require('webpack-hooks-shellscripts').default
22+
const hooksScriptPlugin = require('webpack-hooks-shellscripts')
2323

2424
module.exports = {
2525
plugins: [

src/index.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
export default function plugin(scripts: object): void
1+
declare function hooksShellScriptsPlugin(scripts: object): void
2+
3+
export = hooksShellScriptsPlugin

src/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import execa from 'execa'
2-
import pMapSeries from 'p-map-series'
1+
const execa = require('execa')
2+
const pMapSeries = require('p-map-series')
33

44
const PLUGIN_NAME = 'HooksShellScriptsPlugin'
55

@@ -30,6 +30,8 @@ const registerHook = compiler => ([hook, scripts]) =>
3030
* }
3131
* ```
3232
*/
33-
export default (scripts = {}) => ({
33+
const hooksShellScriptsPlugin = (scripts = {}) => ({
3434
apply: compiler => Object.entries(scripts).map(registerHook(compiler))
3535
})
36+
37+
module.exports = hooksShellScriptsPlugin

0 commit comments

Comments
 (0)