在我最近的项目中,我使用gsap和parcel-bundler创建了一个动画网站。当我想运行它时,我将键入parcel index.html
或npm run dev
,它将在端口1234上启动服务器,使其可以在http://localhost:1234/上访问。
谁能告诉我如何将其部署到netlify或Heroku?
我的package.json文件看起来像这样
{
"name":"expportfolio",
"version":"1.0.0",
"description":"",
"main":"app.js",
"scripts":{
"dev":"parcel index.html",
"build":"parcel build index.html"
},
"author":"",
"license":"ISC",
"devDependencies":{
"cssnano":"^4.1.10",
"sass":"^1.26.7"
},
"dependencies":{
"@dogstudio/highway":"^2.2.1",
"gsap":"^3.3.0"
}
}
答案 0 :(得分:0)
必须有一个包裹中的命令来构建您的项目。您可以将项目上载到netlify,然后将此命令添加到其Build Settings
控制台中,它将使用该命令来构建您的应用程序。您也可以在那里定义很多其他内容。
如果该项目位于github上,则只需将您的github帐户添加到netlify,然后直接将其转移到该帐户即可。
ref:https://docs.netlify.com/configure-builds/get-started/#basic-build-settings
答案 1 :(得分:0)
试试文档中的这个命令:parcel build index.html