trying to package the webapp
This commit is contained in:
@@ -40,5 +40,11 @@
|
|||||||
<script src="src/tinode.js"></script>
|
<script src="src/tinode.js"></script>
|
||||||
<!-- the application -->
|
<!-- the application -->
|
||||||
<script type="text/babel" src="src/webapp.js"></script>
|
<script type="text/babel" src="src/webapp.js"></script>
|
||||||
|
<script type="text/babel">
|
||||||
|
ReactDOM.render(
|
||||||
|
<TinodeWeb />,
|
||||||
|
document.getElementById('mountPoint')
|
||||||
|
);
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+1
-1
@@ -27,6 +27,6 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="mountPoint"></div>
|
<div id="mountPoint"></div>
|
||||||
<script src="index.min.js"></script>
|
<script src="umd/index.prod.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Vendored
-1
File diff suppressed because one or more lines are too long
+9
-3
@@ -16,8 +16,8 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npm run build:babel && npm run build:prod && npm run build:css",
|
"build": "npm run build:babel && npm run build:prod && npm run build:css",
|
||||||
"build:dev": "browserify ./src/index.js --standalone TinodeWeb > ./umd/webapp.dev.js",
|
"build:dev": "browserify ./src/index.js --standalone Webapp > ./umd/index.dev.js",
|
||||||
"build:prod": "browserify ./src/index.js --standalone TinodeWeb --plugin tinyify > ./umd/webapp.prod.js",
|
"build:prod": "browserify ./src/index.js --standalone Webapp --plugin tinyify > ./umd/index.prod.js",
|
||||||
"build:babel": "babel ./src/webapp.js --presets react --out-file ./webapp.js",
|
"build:babel": "babel ./src/webapp.js --presets react --out-file ./webapp.js",
|
||||||
"build:css": "postcss css/base.css > css/base.min.css",
|
"build:css": "postcss css/base.css > css/base.min.css",
|
||||||
"babel-version": "babel --version"
|
"babel-version": "babel --version"
|
||||||
@@ -57,5 +57,11 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/tinode/chat",
|
"homepage": "https://github.com/tinode/chat",
|
||||||
"email": "gene@tinode.co",
|
"email": "gene@tinode.co",
|
||||||
"license": "Apache-2.0"
|
"license": "Apache-2.0",
|
||||||
|
"dependencies": {
|
||||||
|
"react": "^16.4.2",
|
||||||
|
"react-dom": "^16.4.2",
|
||||||
|
"tinode-sdk": "^0.15.5",
|
||||||
|
"tinyify": "^2.4.3"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-5
@@ -1,9 +1,12 @@
|
|||||||
let React = require('react');
|
// Put all packages together.
|
||||||
let ReactDOM = require('react-dom');
|
// Used to generate umd/index.prod.js
|
||||||
let Tinode = require('tinode-sdk');
|
|
||||||
let TinodeWeb = require('webapp.js')
|
var React = require('react');
|
||||||
|
var ReactDOM = require('react-dom');
|
||||||
|
var Tinode = require('tinode-sdk');
|
||||||
|
var TinodeWeb = require('../webapp.js')
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<TinodeWeb />,
|
React.createElement(TinodeWeb, null),
|
||||||
document.getElementById('mountPoint')
|
document.getElementById('mountPoint')
|
||||||
);
|
);
|
||||||
|
|||||||
+3
-4
@@ -5192,7 +5192,6 @@ class TinodeWeb extends React.Component {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ReactDOM.render(
|
if (typeof module != 'undefined') {
|
||||||
<TinodeWeb />,
|
module.exports = TinodeWeb;
|
||||||
document.getElementById('mountPoint')
|
}
|
||||||
);
|
|
||||||
|
|||||||
Reference in New Issue
Block a user