-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
executable file
·55 lines (49 loc) · 1.23 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
var ejs = require('ejs');
var fs = require('fs');
console.log('start');
var file = fs.readFileSync('./output/client/index.ejs', 'utf8');
console.log('1', file);
var rendered = ejs.render(file, {
html: 'asdf',
assets: {
vendor: {
js: 'sadf'
},
client: {
js: '22'
}
}
});
console.log(rendered);
import ReactDOM from 'react-dom';
import React from 'react';
import configureStore from './redux/configureStore';
import { Provider } from 'react-redux';
import { syncHistoryWithStore } from 'react-router-redux';
import { browserHistory } from 'react-router';
import routes from './routes';
// import DevTools from './redux/DevTools';
import injectTapEventPlugin from "react-tap-event-plugin";
// 导入重置样式
import './styles/reset.scss'
const store = configureStore();
const history = syncHistoryWithStore(browserHistory, store);
injectTapEventPlugin();
// ReactDOM.render((
// <Provider store={store}>
// <div>
// {routes(history)}
// <DevTools />
// </div>
// </Provider>
// ), document.getElementById('root'));
ReactDOM.render((
<Provider store={store}>
<div>
{routes(history)}
</div>
</Provider>
), document.getElementById('root'));
if (module && module.hot) {
module.hot.accept();
}