我开始使用Django和Vue.js在digital ocean上做一个小项目。我已经安装了所有东西,但是当我运行
npm run serve
,我在浏览器中只看到一个黑色页面,因为我安装了Django网页加载程序
这是我的包。json
{
"name": "frontend",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.6.5",
"vue": "^3.0.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/compiler-sfc": "^3.0.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^7.0.0-0",
"webpack-bundle-tracker": "^1.0.0-alpha.1"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
这是我的vue.config.js
const BundleTracker = require('webpack-bundle-tracker');
module.exports = {
publicPath: "http://0.0.0.0:8080",
outputDir: "./dist/",
chainWebpack: config => {
config.optimization.splitChunks(false)
config.plugin('BundleTracker').use(BundleTracker, [
{
filename: './webpack-stats.json'
}
])
config.resolve.alias.set('__STATIC__', 'static')
config.devServer
.public('http://0.0.0.0:8080')
.host('0.0.0.0')
.port(8080)
.hotOnly(true)
.watchOptions({poll: 1000})
.https(false)
.headers({'Access-Control-Allow-Origin': ['\*']})
}
};
如何在外部主机(digital ocean)上访问我的应用程序
目前没有回答
相关问题 更多 >
编程相关推荐