config.js
import path from "path"
const __dirname = path.resolve();
export default {
port: 8090,
//打包目标目录
buildPath: './dist/',
//拷贝目录及文件
copy: [
{
//源目录/文件
from: './html',
//目标目录/文件
to: './dist/html',
ignore: ['.*']
}
],
webpack: {
devServer: {
historyApiFallback: true,
allowedHosts: 'all',
host: '0.0.0.0',
// 允许访问静态文件
static: {
directory: path.join(__dirname, ''),
}
}
}
};