Skip to content

Commit

Permalink
Fix: Ship bundled js to avoid import issues with ES + CJS mix
Browse files Browse the repository at this point in the history
  • Loading branch information
therealPaulPlay committed Jan 23, 2025
1 parent b8af795 commit e2c3787
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
1 change: 1 addition & 0 deletions .github/workflows/m-publish-github-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
5 changes: 2 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
src/example.html
dist/
resources/
src/
resources/
14 changes: 9 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "playpeerjs",
"version": "1.0.1",
"version": "1.0.2",
"description": "WebRTC-based wrapper for creating robust peer-2-peer multiplayer systems with ease.",
"main": "src/index.js",
"module": "src/index.js",
"main": "dist/playpeer.js",
"module": "dist/playpeer.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "rollup -c rollup.config.js"
Expand All @@ -26,12 +26,10 @@
"url": "https://github.com/therealPaulPlay/PlayPeerJS/issues"
},
"homepage": "https://github.com/therealPaulPlay/PlayPeerJS#readme",
"dependencies": {
"peerjs": "^1.5.4"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^28.0.2",
"@rollup/plugin-node-resolve": "^16.0.0",
"peerjs": "^1.5.4",
"rollup": "^4.31.0"
}
}
}
3 changes: 1 addition & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pkg from 'peerjs';
const { Peer } = pkg;
import { Peer } from 'peerjs';

const ERROR_PREFIX = "PlayPeer error: ";
const WARNING_PREFIX = "PlayPeer warning: ";
Expand Down

0 comments on commit e2c3787

Please sign in to comment.