我对vue cli有点意见。当我运行npm,运行发球,一切顺利。当我进入dev模式时,npm运行build,构建过程完成。我有一页空白。
错误消息是"Uncaught :意外令牌'<'“
下面是我的设置: pacakge.json
{
"name": "gold",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"test:unit": "vue-cli-service test:unit",
"lint": "vue-cli-service lint",
"build-dev": "vue-cli-service build --mode production-dev",
"build-production": "vue-cli-service build"
},
"dependencies": {
"axios": "^0.21.1",
"babel-polyfill": "^6.26.0",
"camelize2": "^1.0.0",
"core-js": "^3.6.5",
"element-ui": "^2.15.5",
"vue": "^2.6.14",
"vue-carousel": "^0.18.0",
"vue-router": "^3.2.0",
"vuex": "^3.4.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-unit-jest": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/eslint-config-standard": "^5.1.2",
"@vue/test-utils": "^1.0.3",
"babel-eslint": "^10.1.0",
"babel-plugin-component": "^1.1.1",
"eslint": "^6.8.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.0",
"eslint-plugin-vue": "^6.2.2",
"sass": "^1.26.5",
"sass-loader": "^8.0.2",
"vue-template-compiler": "^2.6.14",
"webpack-bundle-analyzer": "^3.9.0"
}
}vue.config.js
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
// .BundleAnalyzerPlugin
module.exports = {
// options...
// configureWebpack: {
// plugins: [new BundleAnalyzerPlugin()]
// },
// configureWebpack: {
// optimization: {
// runtimeChunk: 'single',
// splitChunks: {
// chunks: 'all',
// maxInitialRequests: Infinity,
// minSize: 0,
// cacheGroups: {
// vendor: {
// test: /[\\/]node_modules[\\/]/,
// name(module) {
// // get the name. E.g. node_modules/packageName/not/this/part.js
// // or node_modules/packageName
// const packageName = module.context.match(
// /[\\/]node_modules[\\/](.*?)([\\/]|$)/
// )[1]
// // npm package names are URL-safe, but some servers don't like @ symbols
// return `npm.${packageName.replace('@', '')}`
// }
// }
// }
// }
// }
// },
devServer: {
port: 8989
},
transpileDependencies: ['camelcase']
}对不起,如果我不能显示任何进一步的代码,谢谢。
发布于 2021-12-10 03:01:55
看来你找不到正确的道路了。例如,尝试使用相对路径
module.exports = {
productionSourceMap: false,
outputDir: '../dist',
assetsDir: 'static',
indexPath: 'src/index.html'
};https://stackoverflow.com/questions/70299139
复制相似问题