我使用koa2作为后端和koa-swig来呈现我的页面。这里是结构: 使用vue-cli和webpack构建后无法加载任何css和js文件?
里面的dist文件中,有index.html和static。所有的CSS,JS和图像都在那里。这里是错误:
这里是构建的WebPack的config/index.js
设置:
build: {
env: require('./prod.env'),
index: path.resolve(__dirname, '../dist/index.html'),
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
productionSourceMap: true,
productionGzip: false,
productionGzipExtensions: ['js', 'css'],
bundleAnalyzerReport: process.env.npm_config_report
}