首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用parceljs将我的起始url更改为自定义url

如何使用parceljs将我的起始url更改为自定义url
EN

Stack Overflow用户
提问于 2019-11-27 00:18:51
回答 2查看 498关注 0票数 0
代码语言:javascript
复制
 {
   "name": "openlayers",
   "version": "1.0.0",
   "main": "index.js",
   "scripts": {
   "test": "echo \"Error: no test specified\" && exit 1",
   "start": "parcel  index.html",
   "build": "parcel build --public-url . index.html"
  },
 "author": "",
 "license": "ISC",
 "dependencies": {
 "app-root-path": "^2.2.1",
 "authenticate": "^0.1.5",
 "commonjs": "0.0.1",
 "config": "^3.2.4",
 "document-ready": "^2.0.2",
 "eazy-logger": "^3.0.2",
 "fs": "0.0.1-security",
 "jquery": "^3.4.1",
 "leaflet": "^1.6.0",
 "ol": "^5.3.3",
 "ol-contextmenu": "^3.3.2",
 "ol-hashed": "^2.0.0",
 "ol-layerswitcher": "^3.4.0",
 "proj4": "^2.6.0",
 "sidebar-v2": "^0.4.0",
 "simple-datatables": "^2.1.7",
 "simple-node-logger": "^18.12.23",
 "winston": "^3.2.1",
 "winston-daily-rotate-file": "^3.10.0"
}

任何帮助都将不胜感激。当前的url是http://localhost:1234。我希望这是一个自定义的网址,以认证与第三方服务,将只允许认证到这些网址。

EN

回答 2

Stack Overflow用户

发布于 2019-11-27 00:22:03

根据documentation使用--host选项。

所以在你的脚本部分:

代码语言:javascript
复制
"start": "parcel serve index.html --host example.com",
票数 0
EN

Stack Overflow用户

发布于 2019-11-27 17:49:06

您必须将域添加到主机文件中,然后按照上面所说的操作。

代码语言:javascript
复制
"start": "parcel serve index.html --host example.com",
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59055209

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档