1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-08-08 07:07:15 +02:00

Try react-snap

This commit is contained in:
Phuoc Nguyen
2019-11-15 15:17:09 +07:00
parent 2dd52cf6dd
commit e8f1dae504
3 changed files with 898 additions and 101 deletions

View File

@@ -1,6 +1,9 @@
import React from 'react';
import { render } from 'react-dom';
import { hydrate, render } from 'react-dom';
import App from './App';
render(<App />, document.getElementById('root'));
const rootElement = document.getElementById('root');
rootElement.hasChildNodes()
? hydrate(<App />, rootElement)
: render(<App />, rootElement);

977
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +1,24 @@
{
"name": "csslayout",
"scripts": {
"dev": "parcel client/index.html --out-dir dist/client",
"build": "parcel build client/index.html --out-dir dist/client"
"dev": "parcel client/index.html --out-dir dist",
"build": "parcel build client/index.html --out-dir dist",
"postbuild": "react-snap"
},
"dependencies": {
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-router-dom": "^5.1.2"
"react-router-dom": "^5.1.2",
"react-snap": "^1.23.0"
},
"devDependencies": {
"parcel-bundler": "^1.12.4"
},
"reactSnap": {
"source": "dist",
"minifyHtml": {
"collapseWhitespace": false,
"removeComments": false
}
}
}