File tree 2 files changed +18
-1
lines changed 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,21 @@ import React from 'react';
2
2
import { render } from 'react-dom' ;
3
3
4
4
class Root extends React . Component {
5
+ constructor ( props ) {
6
+ super ( props ) ;
7
+ this . click = this . click . bind ( this ) ;
8
+ }
9
+
10
+ click ( ) {
11
+ alert ( 'click this' ) ;
12
+ }
13
+
5
14
render ( ) {
6
15
return (
7
16
< div >
8
17
< h1 > Hello world</ h1 >
9
18
< input type = "checkbox" />
19
+ < button onClick = { this . click } > try this</ button >
10
20
</ div >
11
21
) ;
12
22
}
Original file line number Diff line number Diff line change 1
1
const base = require ( './webpack.base.js' ) ,
2
+ webpack = require ( 'webpack' ) ,
2
3
dev = {
3
4
module : {
4
5
loaders : [ {
@@ -10,7 +11,13 @@ const base = require('./webpack.base.js'),
10
11
presets : [ 'es2015' , 'react' , 'react-hmre' ]
11
12
}
12
13
} ]
13
- }
14
+ } ,
15
+ plugins : [
16
+ new webpack . SourceMapDevToolPlugin ( {
17
+ filename : '[name].js.map' ,
18
+ exclude : [ 'vendor.js' ]
19
+ } )
20
+ ]
14
21
} ;
15
22
16
23
module . exports = Object . assign ( base , dev ) ;
You can’t perform that action at this time.
0 commit comments