[英]How to deploy a static website on azure using Visual Code studio?
I have been following this tutorial to develop and build a nodejs application. 我一直在遵循本教程来开发和构建nodejs应用程序。 When I use the command to build the package.json file, missing script: build
error was coming. 当我使用命令生成package.json文件时, missing script: build
错误即将来临。 A possible solution to this is manually edit the "build" key:value pair in the package.json file, but I have no idea what to add in value
part of it for building the webapp. 一个可能的解决方案是手动编辑“构建”键:在文件的package.json值对的,但我不知道在增加value
的一部分用于构建web应用程序。 Currently my package.json contains: 目前,我的package.json包含:
{ "name": "my-react-app", "version": "0.1.0", "private": true, "scripts": { "build": "echo 'build script executed'" } }
After it, a folder named build should be there but it is not happening where all the html, css and js files will go. { "name": "my-react-app", "version": "0.1.0", "private": true, "scripts": { "build": "echo 'build script executed'" } }
之后,应该有一个名为build的文件夹,但是所有html,css和js文件都不会放到那里。 All of the packages are upto date. 所有的软件包都是最新的。 Running windows 10. 运行Windows 10。
I also follow the tutorial you metioned. 我还遵循您提到的教程。 I can build the webapp correclty on my side. 我可以在自己的身边建立webapp的正确性。 The build script: react-scripts build
. 构建脚本: react-scripts build
。 For more detail information about Package.json please refer to my package.json. 有关Package.json的更多详细信息,请参阅我的package.json。
My Package.json 我的Package.json
{
"name": "my-react-appp",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.4.2",
"react-dom": "^16.4.2",
"react-scripts": "1.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
If you haven't installed the Azure App Service extension , then you need to install it from Visual Studio code Marketplace. 如果尚未安装Azure App Service扩展,则需要从Visual Studio代码市场进行安装。 After that you could publish it to Azure webApp directly with VS code. 之后,您可以直接使用VS代码将其发布到Azure webApp。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.