Skip to content

Commit

Permalink
fix #56, #57 support electron without network
Browse files Browse the repository at this point in the history
  • Loading branch information
cwtuan committed Apr 21, 2018
1 parent bc50f3a commit c43fdb0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/browser-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"react-scripts": "0.8.4"
},
"dependencies": {
"react-intl-universal": "^1.7.2",
"react-intl-universal": "*",
"axios": "^0.16.1",
"lodash": "^4.17.4",
"react": "^15.5.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/node-js-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"react-scripts": "^0.9.0"
},
"dependencies": {
"react-intl-universal": "^1.7.2",
"react-intl-universal": "*",
"react": "^15.5.4",
"react-dom": "^15.5.4"
},
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-intl-universal",
"version": "1.9.3",
"version": "1.10.1",
"description": "Internationalize React apps. Not only for React.Component but also for Vanilla JS.",
"keywords": [
"intl",
Expand Down Expand Up @@ -33,6 +33,7 @@
"intl": "^1.2.5",
"intl-messageformat": "^2.2.0",
"invariant": "^2.2.2",
"is-electron": "^2.1.0",
"load-script": "^1.0.0",
"lodash.merge": "^4.6.1",
"object-keys": "^1.0.11",
Expand Down
3 changes: 2 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export default {
'querystring',
'react',
'console-polyfill',
'lodash.merge'
'lodash.merge',
'is-electron'
],
plugins : [babel({exclude: 'node_modules/**', presets: ['es2015-rollup']})]
};
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import invariant from "invariant";
import "console-polyfill";
import * as constants from "./constants";
import merge from "lodash.merge";
import isElectron from 'is-electron';

const COMMON_LOCALE_DATA_URLS = {
en: "https://g.alicdn.com/react-intl-universal/locale-data/1.0.0/en.js",
Expand All @@ -24,7 +25,7 @@ const COMMON_LOCALE_DATA_URLS = {
};


const isBrowser = typeof window !== "undefined";
const isBrowser = !isElectron() && typeof window !== "undefined";

String.prototype.defaultMessage = String.prototype.d = function (msg) {
return this || msg || "";
Expand Down

0 comments on commit c43fdb0

Please sign in to comment.