-
Notifications
You must be signed in to change notification settings - Fork 144
Fix: Jest expects commonjs module by default #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,11 @@ | |
"name": "sendbird-uikit", | ||
"version": "2.6.0", | ||
"description": "React based UI kit for sendbird", | ||
"main": "release/index.js", | ||
"style": "release/dist/index.css", | ||
"typings": "release/index.d.ts", | ||
"module": "release/index.js", | ||
"main": "dist/cjs/index.js", | ||
"style": "dist/index.css", | ||
"typings": "dist/index.d.ts", | ||
"module": "dist/index.js", | ||
"files": [ | ||
"release/**/*", | ||
"dist/**/*", | ||
"package-lock.json", | ||
"LICENSE", | ||
|
@@ -19,9 +18,8 @@ | |
"scripts": { | ||
"test": "jest", | ||
"test-update-snapshot": "jest -u", | ||
"cp-css": "./scripts/copy-css.sh", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I cleaned up the rollup config so that this is no longer necessary. Rollup now outputs everything into |
||
"clean-release": "rm -rf ./release; rm -rf ./dist", | ||
"build": "npm run clean-release; rollup -c; npm run cp-css", | ||
"clean-release": "rm -rf ./dist", | ||
"build": "npm run clean-release; rollup -c", | ||
"start": "rollup -c -w", | ||
"prepublishOnly": "npm run build", | ||
"predeploy": "cd example && npm install && npm run build", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,14 +35,16 @@ module.exports = ({ | |
}, | ||
output: [ | ||
{ | ||
dir: 'release/dist/cjs', | ||
dir: 'dist/cjs', | ||
format: 'cjs', | ||
sourcemap: true, | ||
exports: 'named' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This fixes a warning:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We would remove this, makes our scope a little wider |
||
}, | ||
{ | ||
dir: 'release', | ||
dir: 'dist', | ||
format: 'esm', | ||
sourcemap: true, | ||
exports: 'named' | ||
}, | ||
], | ||
external: [ | ||
|
@@ -63,7 +65,7 @@ module.exports = ({ | |
autoprefixer, | ||
], | ||
sourceMap: true, | ||
extract: 'dist/index.css', | ||
extract: 'index.css', | ||
extensions: ['.sass', '.scss', '.css'], | ||
}), | ||
replace({ | ||
|
@@ -97,6 +99,7 @@ module.exports = ({ | |
}, | ||
], | ||
], | ||
babelHelpers: 'bundled', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This fixes a warning:
|
||
extensions: ['.tsx', '.ts', '.jsx', '.js'], | ||
exclude: 'node_modules/**', | ||
plugins: [ | ||
|
@@ -114,7 +117,7 @@ module.exports = ({ | |
targets: [ | ||
{ | ||
src: './src/index.d.ts', | ||
dest: 'release', | ||
dest: 'dist', | ||
}, | ||
], | ||
}), | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the jest issue.
I also moved the files into dist. I'm not sure why there was
release
anddist
but it didn't seem necessary and was easy to clean up.This should be backwards compatible since users shouldn't be referencing the
release
paths directly.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was due to some legacy customer request, but, can remove now :)