Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何为Reactjs重新启动NPM_Reactjs_Npm_Localhost - Fatal编程技术网

如何为Reactjs重新启动NPM

如何为Reactjs重新启动NPM,reactjs,npm,localhost,Reactjs,Npm,Localhost,我是如何使用NPM设置reactjs的新手,当我看到输出显示为“hello world”时,设置非常有效,转到URL localhost:8080 但这次我创建了更多的新文件夹,将index.html和index.js移到新文件夹中,我从新文件夹下的“hello world”改为“It works great”,但当前显示的是旧的输出“hello world” 我的问题是,在更改webconfig.js和package.json之后,如何重新运行NPM!输出应该显示在新文件夹文件下 您当前是否使

我是如何使用NPM设置reactjs的新手,当我看到输出显示为“hello world”时,设置非常有效,转到URL localhost:8080

但这次我创建了更多的新文件夹,将index.html和index.js移到新文件夹中,我从新文件夹下的“hello world”改为“It works great”,但当前显示的是旧的输出“hello world”


我的问题是,在更改webconfig.js和package.json之后,如何重新运行NPM!输出应该显示在新文件夹文件下

您当前是否使用任何Web服务器为应用程序提供服务?你可以使用webPack或gulp。网页是我的首选。您可以在配置时看到热加载程序选项。热加载程序提供了监听任何文件中提到的更改的选项。

我在pack.json中使用这个热加载程序。脚本“{”start“:”webpack dev server--hot“,”build“:”webpack-d&&cp src/index.html dist/indx.html&&webpack dev server--content base src/--inline--hot“,”build:prod“:”webpack-p&&cp src/index.html dist/index.html”},您可以在中查看package.jason请在jsfiddle.net中查看my package.jason都是webconfig.js文件。我需要查看package.json文件,其中包含运行服务器的所有依赖项信息和脚本。