@@ -23,8 +23,6 @@ const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
23
23
const paths = require ( './paths' ) ;
24
24
const getClientEnvironment = require ( './env' ) ;
25
25
26
- const appPackage = require ( paths . appPackageJson ) ;
27
-
28
26
// Webpack uses `publicPath` to determine where the app is being served from.
29
27
// It requires a trailing slash, or the file assets will get an incorrect path.
30
28
const publicPath = paths . servedPath ;
@@ -56,13 +54,6 @@ const extractTextPluginOptions = shouldUseRelativeAssetPaths
56
54
{ publicPath : Array ( cssFilename . split ( '/' ) . length ) . join ( '../' ) }
57
55
: { } ;
58
56
59
- const alias = ! appPackage . alias
60
- ? { }
61
- : Object . keys ( appPackage . alias ) . reduce ( ( previous , current ) => {
62
- previous [ current ] = path . resolve ( paths . appPath , appPackage . alias [ current ] ) ;
63
- return previous ;
64
- } , { } ) ;
65
-
66
57
// This is the production configuration.
67
58
// It compiles slowly and is focused on producing a fast and minimal bundle.
68
59
// The development configuration is different and lives in a separate file.
@@ -106,7 +97,7 @@ module.exports = {
106
97
// `web` extension prefixes have been added for better support
107
98
// for React Native Web.
108
99
extensions : [ '.web.js' , '.js' , '.json' , '.web.jsx' , '.jsx' ] ,
109
- alias : Object . assign ( { } , alias , {
100
+ alias : {
110
101
// @remove -on-eject-begin
111
102
// Resolve Babel runtime relative to react-scripts.
112
103
// It usually still works on npm 3 without this but it would be
@@ -119,7 +110,8 @@ module.exports = {
119
110
// Support React Native Web
120
111
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
121
112
'react-native' : 'react-native-web' ,
122
- } ) ,
113
+ 'src' : paths . appSrc ,
114
+ } ,
123
115
plugins : [
124
116
// Prevents users from importing files from outside of src/ (or node_modules/).
125
117
// This often causes confusion because we only process files within src/ with babel.
0 commit comments