简体   繁体   中英

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. When I use the command to build the package.json file, missing script: build error was coming. 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. Currently my package.json contains:
{ "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. All of the packages are upto date. Running windows 10.

I also follow the tutorial you metioned. I can build the webapp correclty on my side. The build script: react-scripts build . For more detail information about Package.json please refer to my package.json.

My 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. After that you could publish it to Azure webApp directly with VS code.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM