diff --git a/npm/.gitignore b/npm/.gitignore index 1061704c7..0f9536cec 100644 --- a/npm/.gitignore +++ b/npm/.gitignore @@ -4,3 +4,4 @@ !.gitignore !.npmignore !README.md +!middleware.mjs diff --git a/npm/middleware.mjs b/npm/middleware.mjs new file mode 100644 index 000000000..f7eb6dc76 --- /dev/null +++ b/npm/middleware.mjs @@ -0,0 +1,3 @@ +import cjs from './middleware/index.js'; + +export default cjs.default; diff --git a/tasks/webpack/middleware.js b/tasks/webpack/middleware.js index 3c33942d8..60fb9162a 100644 --- a/tasks/webpack/middleware.js +++ b/tasks/webpack/middleware.js @@ -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', },