我有一个带有Node和MongoDB的全栈Vue应用程序。当我使用Heroku CLI将其部署到Heroku时,一切都构建良好,但是当我打开应用程序时,它显示空白页面。我知道可能有很多原因,但是我很确定我在配置文件中做错了什么,无论是webpack还是eslint等。任何想法都将不胜感激!
从Heroku CLI
Delta compression using up to 4 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 862 bytes | 862.00 KiB/s, done.
Total 9 (delta 5), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote: NODE_VERBOSE=false
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): 12.2.0
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version 12.2.0...
remote: Downloading and installing node 12.2.0...
remote: Using default npm version: 6.9.0
remote:
remote: -----> Restoring cache
remote: - node_modules
remote:
remote: -----> Installing dependencies
remote: Installing node modules (package.json + package-lock)
remote:
remote: > nodent-runtime@3.2.1 install /tmp/build_6acdcefd755fbf3c1b13db0b077c27aa/node_modules/nodent-runtime
remote: > node build.js
remote:
remote: ## Built /tmp/build_6acdcefd755fbf3c1b13db0b077c27aa/node_modules/nodent-runtime/dist/index.js
remote:
remote: > yorkie@2.0.0 install /tmp/build_6acdcefd755fbf3c1b13db0b077c27aa/node_modules/yorkie
remote: > node bin/install.js
remote:
remote: setting up Git hooks
remote: can't find .git directory, skipping Git hooks installation
remote:
remote: > ejs@2.7.4 postinstall /tmp/build_6acdcefd755fbf3c1b13db0b077c27aa/node_modules/ejs
remote: > node ./postinstall.js
remote:
remote: added 962 packages from 1106 contributors and audited 36327 packages in 30.893s
remote: found 0 vulnerabilities
remote:
remote:
remote: -----> Build
remote: Running build
remote:
remote: > tradish@0.1.0 build /tmp/build_6acdcefd755fbf3c1b13db0b077c27aa
remote: > vue-cli-service build
remote:
remote:
remote: - Building for production...
remote: DONE Compiled successfully in 3571ms10:38:53 PM
remote:
remote: File Size Gzipped
remote:
remote: dist/js/chunk-vendors.fc529923.js 23.70 KiB 8.65 KiB
remote: dist/js/app.d6a75270.js 1.64 KiB 0.81 KiB
remote:
remote: Images and other types of assets omitted.
remote:
remote: DONE Build complete. The dist directory is ready to be deployed.
remote: INFO Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html
remote:
remote:
remote: -----> Pruning devDependencies
remote:
remote: > yorkie@2.0.0 uninstall node_modules/yorkie
remote: > node bin/uninstall.js
remote:
remote: husky
remote: uninstalling Git hooks
remote: done
remote:
remote: removed 962 packages and audited 5070 packages in 16.92s
remote: found 0 vulnerabilities
remote:
remote:
remote: -----> Caching build
remote: - node_modules
remote:
remote: -----> Build succeeded!
remote: -----> Static HTML app detected
remote: % Total % Received % Xferd Average Speed Time Time Time Current
remote: Dload Upload Total Spent Left Speed
remote: 100 838k 100 838k 0 0 15.1M 0 --:--:-- --:--:-- --:--:-- 15.1M
remote: -----> Installed directory to /app/bin
remote: -----> Discovering process types
remote: Procfile declares types -> (none)
remote: Default types for buildpack -> web
remote:
remote: -----> Compressing...
remote: Done: 48.2M
remote: -----> Launching...
remote: Released v18
remote: https://tradish.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/tradish.git
13fbf2e..8aec533 master -> master
Webpack
module.exports = {
entry: {
main: "./src/client/main.js"
},
mode: "production"
};
.eslintrc.json
{
"root": true,
"extends": [
// add more generic rulesets here, such as:
"plugin:vue/base"
],
"rules": {
"strict": 0,
"semi": "error"
},
"parserOptions": {
"parser": "babel-eslint",
"ecmaVersion": 2018,
"sourceType": "module",
"ecmaFeatures": {
"modules": true,
"experimentalObjectRestSpread": true
}
}
}
static.json
{
"root": "dist",
"clean_urls": true,
"routes": {
"/**": "index.html"
}
}
文件夹结构
dist
js
index.html
node_modules
public
src
client
server
config.js
.eslintrc.json
babel.config.js
package-lock.json
package.json
static.json
webpack.config.js