简体   繁体   English

如何使用Visual Code Studio在Azure上部署静态网站?

[英]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.

相关问题 Visual Studio-将现有网站/ webAPI部署到Azure - Visual Studio - deploy existing website/webAPI to Azure Visual Studio 2013.3通过Web部署发布到Azure网站验证连接失败,没有错误代码 - Visual Studio 2013.3 publish to azure website via web deploy validate connection fails with no error code 如何使用 Visual Studio Online 在 Azure VM 中部署 Web 应用程序 - How deploy Web application in Azure VM using Visual studio online 使用visual studio web deploy在asp MVC中部署到azure网站时,某些文件夹不会被推送到服务器 - Some folder are not pushed to server when deployed to azure website in asp MVC using visual studio web deploy 从Visual Studio部署Azure网站-如何仅部署一个缺少的程序集? - Azure Website Deployment from Visual Studio - How to deploy just a single missing assembly? 如何从Visual Studio部署到Azure - How to deploy from Visual Studio to Azure 使用Visual Studio将带有网站的DLL发布到Azure - Publish dll with website to Azure using Visual Studio 如何使用Visual Studio但不使用Azure模拟器将现有的Web应用程序项目部署到Azure? - How do I deploy an existing web app project to Azure using Visual Studio but no Azure Emulator? 如何从Visual Studio将Azure Service Bus部署到Azure - How to Deploy Azure Service Bus to Azure from Visual Studio Azure:使用Visual Studio Team Services从源代码管理部署 - Azure: Deploy from source control using Visual Studio Team Services
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM