diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index a3db11f8ec7..2cf435d23cc 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -65,6 +65,7 @@ module.exports = { publicPath: '/' }, resolve: { + root: paths.appSrc, // These are the reasonable defaults supported by the Node ecosystem. extensions: ['.js', '.json', ''], alias: { diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 2a3b1a81868..d8c386b23cd 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -60,6 +60,7 @@ module.exports = { publicPath: publicPath }, resolve: { + root: paths.appSrc, // These are the reasonable defaults supported by the Node ecosystem. extensions: ['.js', '.json', ''], alias: { diff --git a/template/src/App.js b/template/src/App.js index d7d52a7f38a..7c749cd29ae 100644 --- a/template/src/App.js +++ b/template/src/App.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; -import logo from './logo.svg'; -import './App.css'; +import logo from 'logo.svg'; +import 'App.css'; class App extends Component { render() { diff --git a/template/src/index.js b/template/src/index.js index 54c5ef1a427..0a618618ea7 100644 --- a/template/src/index.js +++ b/template/src/index.js @@ -1,7 +1,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import App from './App'; -import './index.css'; +import App from 'App'; +import 'index.css'; ReactDOM.render( ,