File tree Expand file tree Collapse file tree 4 files changed +8
-4
lines changed
template/src/routes/About Expand file tree Collapse file tree 4 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,7 @@ module.exports = {
157157 // @remove -on-eject-begin
158158 babelrc : false ,
159159 presets : [ require . resolve ( 'babel-preset-react-app' ) ] ,
160+ plugins : [ 'syntax-dynamic-import' ] ,
160161 // @remove -on-eject-end
161162 // This is a feature of `babel-loader` for webpack (not Babel itself).
162163 // It enables caching results in ./node_modules/.cache/babel-loader/
Original file line number Diff line number Diff line change @@ -164,6 +164,7 @@ module.exports = {
164164 options : {
165165 babelrc : false ,
166166 presets : [ require . resolve ( 'babel-preset-react-app' ) ] ,
167+ plugins : [ 'syntax-dynamic-import' ] ,
167168 } ,
168169 // @remove -on-eject-end
169170 } ,
Original file line number Diff line number Diff line change 2828 "babel-eslint" : " 7.1.1" ,
2929 "babel-jest" : " 18.0.0" ,
3030 "babel-loader" : " 6.3.2" ,
31+ "babel-plugin-syntax-dynamic-import" : " ^6.18.0" ,
3132 "babel-preset-react-app" : " ^2.1.1" ,
3233 "babel-runtime" : " ^6.20.0" ,
3334 "case-sensitive-paths-webpack-plugin" : " 1.1.4" ,
Original file line number Diff line number Diff line change 11export default ( store ) => ( {
22 path : '/about' ,
33 getComponent ( nextState , cb ) {
4- require . ensure ( [ ] , ( require ) => {
5- const About = require ( './containers/AboutContainer' ) . default
6- cb ( null , About )
7- } , 'about' )
4+ import ( './containers/AboutContainer' ) . then ( ( About ) => {
5+ cb ( null , About . default )
6+ } ) . catch ( ( err ) => {
7+ console . error ( 'Failed to load module' , err )
8+ } )
89 }
910} )
You can’t perform that action at this time.
0 commit comments