Skip to content
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

For SSR compatibility, add CJS build and guard global variable access #819

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SHELL := /bin/bash

.PHONY: build_all
build_all: web react-native node worker
build_all: web cjs react-native node worker

.PHONY: json2
json2:
Expand All @@ -22,6 +22,14 @@ web:
@echo "Minified Browser Release (with encryption)"
INCLUDE_TWEETNACL=true node_modules/webpack/bin/webpack.js --config=webpack/config.web.js

.PHONY: cjs
cjs:
@echo "CommonJS Release:"
MINIMIZE=false node_modules/webpack/bin/webpack.js --config=webpack/config.cjs.js

@echo "CommonJS Release (with encryption)"
INCLUDE_TWEETNACL=true MINIMIZE=false node_modules/webpack/bin/webpack.js --config=webpack/config.cjs.js

.PHONY: react-native
react-native:
@echo "React Native Release:"
Expand Down
1 change: 1 addition & 0 deletions cjs/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../dist/cjs/pusher');
1 change: 1 addition & 0 deletions cjs/with-encryption/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../dist/cjs/pusher-with-encryption');
Loading