Skip to content

Commit ed33d57

Browse files
author
caoli
committed
fix: production mode, target node not import react-hot-loader
1 parent e681675 commit ed33d57

File tree

6 files changed

+19
-16
lines changed

6 files changed

+19
-16
lines changed

.babelrc

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
{
22
"presets": [
3-
"react",
4-
["env", { "modules": false }]
3+
"react", ["env", {
4+
"modules": false
5+
}]
56
],
67
"plugins": [
7-
"react-hot-loader/babel",
88
"transform-object-assign",
9-
"syntax-dynamic-import",
10-
"transform-object-rest-spread",
11-
["import", { libraryName: "antd", style: "css" }]],
9+
"syntax-dynamic-import",
10+
"transform-object-rest-spread", ["import", {
11+
"libraryName": "antd",
12+
"style": "css"
13+
}]
14+
],
15+
"env": {
16+
"development": {
17+
"plugins": [
18+
"react-hot-loader/babel"
19+
]
20+
}
21+
},
1222
"comments": false
1323
}

app/web/component/spa/redux/actions.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { ADD, DEL } from './constant';
22

33
export const add = item => {
4-
console.log('item', item);
54
return {
65
type: ADD,
76
item

app/web/component/spa/redux/components/home.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ class Home extends Component {
5555

5656

5757
const mapStateToProps = state => {
58-
console.log('mapStateToProps', state);
5958
return {
6059
list: state.list
6160
};

app/web/component/spa/ssr/components/home.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ class Home extends Component {
8181

8282

8383
const mapStateToProps = state => {
84-
console.log('mapStateToProps', state);
8584
return {
8685
list: state.list
8786
};

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
"egg-webpack-react": "^2.0.2",
5656
"eslint-config-egg": "^5.1.1",
5757
"eslint-plugin-react": "^7.1.0",
58-
"imagemin-webpack-plugin": "^1.5.2",
5958
"ip": "^1.1.5",
6059
"less": "^2.7.2",
6160
"less-loader": "^4.0.5",

webpack.config.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
egg: true,
33
framework: 'react',
4-
// devtool: 'source-map',
4+
devtool: 'source-map',
55
entry: {
66
include: ['app/web/page',
77
{ layout: 'app/web/framework/layout/layout.jsx?loader=false' },
@@ -25,13 +25,10 @@ module.exports = {
2525
include: 'app/web/page/css/module'
2626
},
2727
dll: ['react', 'react-dom'],
28-
loaders: {
29-
30-
},
28+
loaders: {},
3129
plugins: {
32-
30+
imagemini: false
3331
},
34-
3532
done() {
3633
console.log('---webpack compile finish---');
3734
}

0 commit comments

Comments
 (0)