Skip to content

Commit 5929051

Browse files
authored
fix: Set package.json type as module (#227)
ESM library should have "type": "module" (package.json file that is going to /dist) This fixes Cannot use import outside module issue in next.js fixes: https://sendbird.atlassian.net/browse/UIKIT-1980
1 parent ab7918f commit 5929051

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

rollup.config.js

+4
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ module.exports = ({
111111
src: './src/index.d.ts',
112112
dest: 'dist',
113113
},
114+
{
115+
src: './package.lock.json',
116+
dest: 'dist',
117+
},
114118
],
115119
}),
116120
],

scripts/package.template.json

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "@sendbird/uikit-react",
33
"version": "{{ version }}",
44
"description": "React based UI kit for sendbird",
5+
"type": "module",
56
"main": "index.js",
67
"style": "dist/index.css",
78
"typings": "index.d.ts",

scripts/steps.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
1. Run npm build
22
2. Update and replace dist/index.d.ts with scripts/index_d_ts
33
3. Update and replace dist/package.json with scripts/package.template.json
4+
* "type": "module"(only in package.template.json) need migration work in package.json
5+
* Updated import paths
6+
* Remove unnecessary scripts(build etc etc)
47
4. Update and replace dist/README.md with main README.md
58
4. Update and replace dist/CHANGELOG.md with main CHANGELOG.md
69
4. Update and replace dist/LICENSE with main LICENSE

0 commit comments

Comments
 (0)