create-chayns-app 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-chayns-app",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "private": false,
5
5
  "description": "Create a new chayns® development project in one command.",
6
6
  "keywords": [
@@ -1,15 +1,16 @@
1
1
  import React from 'react';
2
- import ReactDOM from 'react-dom';
2
+ import { createRoot } from 'react-dom/client';
3
3
  import App from './components/App';
4
4
 
5
- chayns.ready
6
- .then(() => {
7
- try {
8
- ReactDOM.render(<App />, document.querySelector('#root'));
9
- } catch (e) {
10
- console.error('Encountered error at `ReactDOM.render`: ', e);
11
- }
12
- })
13
- .catch((error) => {
14
- console.warn('No chayns environment found.', error);
15
- });
5
+ try {
6
+ await chayns.ready;
7
+ } catch (ex) {
8
+ console.warn('No chayns environment found.', ex);
9
+ }
10
+
11
+ try {
12
+ const root = createRoot(document.querySelector('#root'));
13
+ root.render(<App />);
14
+ } catch (ex) {
15
+ console.error('Encountered error at `ReactDOM.render`: ', ex);
16
+ }
@@ -0,0 +1,18 @@
1
+ const { buildToolkitConfig } = require('chayns-toolkit');
2
+
3
+ module.exports = buildToolkitConfig({
4
+ development: {
5
+ host: '0.0.0.0',
6
+ port: process.env.PORT || 8080,
7
+ },
8
+ output: {
9
+ entryPoints: {
10
+ index: {
11
+ pathIndex: './src/index',
12
+ pathHtml: './src/index.html',
13
+ },
14
+ // Add more entrypoints here
15
+ },
16
+ cssVersion: '4.2',
17
+ },
18
+ });