javascript - ReactJS: Module parse failed ',,.../index.js' you may need appropriate loader to handle this file type -


i change default index.js file location generated create-react-app.

this directory structure :-

|--main-project    |--client       |--components       |--pages       |--public       |--app.js       |--index.js    |--mode_modules    |--server    |--package.json    |    |-- /react small files package-lock.json , stuff 

my corresponding path.js configuration in node_module/react-scripts/config

module.exports = {   dotenv: resolveapp('.env'),   apppath: resolveapp('.'),   appbuild: resolveapp('build'),   apppublic: resolveapp('public'),   apphtml: resolveapp('client/public/index.html'),   appindexjs: resolveapp('client/index.js'),   apppackagejson: resolveapp('package.json'),   appsrc: resolveapp('src'),   yarnlockfile: resolveapp('yarn.lock'),   testssetup: resolveapp('src/setuptests.js'),   appnodemodules: resolveapp('node_modules'),   publicurl: getpublicurl(resolveapp('package.json')),   servedpath: getservedpath(resolveapp('package.json')), // these properties exist before ejecting:  ownpath: resolveown('.'),  ownnodemodules: resolveown('node_modules'), // empty on npm 3 }; 

i have changed apphtml , appindexjs path

how tell default jsx loader see these files ?

change appsrc:resolveapp('src') appsrc:resolveapp('client')

everthing should work fine !

its not necessary use default file structure, can configure discussed above.


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -