素材巴巴 > 程序开发 >

打包生成的dist文件如何在本地运行

程序开发 2023-09-11 08:41:39

1,首先,在angular项目中执行命令yarn build或者npm run build,打包生成dist,

2,到相应的dist目录下面,执行命令 npx hs . ,运行起来的环境如下截图:

3,如果package.json中配置了基础路径如下:

  "build": "npm run copy&ng build --prod --outputPath=dist/cicd --base-href=/cicd/",

配置了--base-href,在浏览器访问项目时候链接为localhost:8080/cicd/index.html

到此就可在本地访问我们的打包项目了


标签:

素材巴巴 Copyright © 2013-2021 http://www.sucaibaba.com/. Some Rights Reserved. 备案号:备案中。