Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0438a09

Browse files
committed
Fix dev mode, turn off react concurrent mode, update dependencies
1 parentdf71c54 commit0438a09

File tree

76 files changed

+1466
-689
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1466
-689
lines changed

‎assets/bindata.go‎

Lines changed: 116 additions & 116 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎client/.babelrc.js‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@ module.exports = {
1313
['@babel/plugin-proposal-class-properties',{loose:true}],
1414
'@babel/plugin-proposal-export-default-from',
1515
'@babel/plugin-proposal-export-namespace-from',
16-
'@babel/plugin-syntax-dynamic-import'
16+
'@babel/plugin-syntax-dynamic-import',
17+
'react-hot-loader/babel'
1718
],
1819
env:{
19-
development:{
20-
plugins:['react-hot-loader/babel']
21-
},
2220
test:{
2321
plugins:['@babel/plugin-transform-modules-commonjs']
2422
},

‎client/js/components/Root.js‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
importReactfrom'react';
22
import{Provider}from'react-redux';
3-
import{hot,setConfig}from'react-hot-loader';
3+
import{hot}from'react-hot-loader';
44
importAppfrom'containers/App';
55

6-
setConfig({
7-
pureSFC:true
8-
});
9-
106
constRoot=({ store})=>(
117
<Providerstore={store}>
128
<App/>

‎client/js/hot.js‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import{setConfig}from'react-hot-loader';
2+
importReactDOMfrom'react-dom';
3+
4+
setConfig({
5+
ignoreSFC:!!ReactDOM.setHotElementComparator,
6+
pureSFC:true,
7+
pureRender:true
8+
});

‎client/js/index.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import'./hot';
12
importReactfrom'react';
2-
import{createRoot}from'react-dom';
3+
import{render}from'react-dom';
34

45
importRootfrom'components/Root';
56
import{appSet}from'state/app';
@@ -23,7 +24,7 @@ const store = configureStore(socket);
2324
initRouter(routes,store);
2425
runModules({ store, socket});
2526

26-
createRoot(document.getElementById('root')).render(<Rootstore={store}/>);
27+
render(<Rootstore={store}/>,document.getElementById('root'));
2728

2829
window.addEventListener('beforeinstallprompt',e=>{
2930
e.preventDefault();

‎client/webpack.config.dev.js‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ var postcssPresetEnv = require('postcss-preset-env');
44

55
module.exports={
66
mode:'development',
7-
entry:['webpack-hot-middleware/client','./js/index'],
7+
entry:{
8+
main:['webpack-hot-middleware/client','./js/index'],
9+
boot:'./js/boot'
10+
},
811
output:{
9-
filename:'bundle.js',
12+
filename:'[name].js',
1013
publicPath:'/'
1114
},
1215
resolve:{
@@ -28,7 +31,11 @@ module.exports = {
2831
fix:true
2932
}
3033
},
31-
{test:/\.js$/,loader:'babel-loader',exclude:/node_modules/},
34+
{
35+
test:/\.js$/,
36+
use:['babel-loader','react-hot-loader/webpack'],
37+
exclude:/node_modules/
38+
},
3239
{
3340
test:/\.css$/,
3441
use:[

‎client/webpack.config.prod.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ module.exports = {
7979
filename:'[name].[contenthash].css',
8080
chunkFilename:'[name].[contenthash].css'
8181
}),
82+
newHashOutputPlugin(),
8283
newInjectManifest({
8384
swSrc:'./js/sw.js',
8485
importWorkboxFrom:'local',
@@ -90,8 +91,7 @@ module.exports = {
9091
/^boot.*\.js$/,
9192
/^runtime.*\.js$/
9293
]
93-
}),
94-
newHashOutputPlugin()
94+
})
9595
],
9696
optimization:{
9797
minimizer:[

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp