Skip to content

Commit

Permalink
add native esm entry point (#2078)
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-bus-stop authored Jun 29, 2021
1 parent 31d377c commit 67816f1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions npm/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
!.gitignore
!.npmignore
!README.md
!middleware.mjs
3 changes: 3 additions & 0 deletions npm/middleware.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import cjs from './middleware/index.js';

export default cjs.default;
10 changes: 10 additions & 0 deletions tasks/webpack/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ class MiddlewarePackageJsonPlugin {
},
type: 'commonjs',
main: './middleware/index.js',
exports: {
'.': {
import: './middleware.mjs',
default: './middleware/index.js',
},
'./middleware': {
import: './middleware.mjs',
default: './middleware/index.js',
},
},
bin: {
'u-wave-web': './bin/u-wave-web',
},
Expand Down

0 comments on commit 67816f1

Please sign in to comment.