You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

57 lines
1.6 KiB

// module.exports = {
// transpileDependencies:['@dcloudio/uni-ui'],
// //开发模式反向代理配置,生产模式请使用Nginx部署并配置反向代理
// devServer: {
// port: 8080,
// open: true,
// proxy: {
// '/api': {
// //本地服务接口地址
// // target: 'http://localhost',
// //远程演示服务地址,可用于直接启动项目
// target: 'http://211.149.177.229:9082/',
// changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
// ws: true,
// pathRewrite: {
// '^/api': '/'
// }
// }
// }
// }
// }
// //vue.config.js
// const TransformPages = require('uni-read-pages')
// const {webpack} = new TransformPages()
// module.exports = {
// configureWebpack: {
// plugins: [
// new webpack.DefinePlugin({
// ROUTES: webpack.DefinePlugin.runtimeValue(() => {
// const tfPages = new TransformPages({
// includes: ['path', 'name', 'aliasPath']
// });
// return JSON.stringify(tfPages.routes)
// }, true )
// })
// ]
// }
// }
let filePath = ''
let Timestamp = ''
//编译环境判断,判断是否H5环境
if (process.env.UNI_PLATFORM === 'h5') {
filePath = 'static/js/'; //打包文件存放文件夹路径
Timestamp = '.' + new Date().getTime();//时间戳
}
module.exports = {
configureWebpack: { // webpack 配置 解决js缓存的问题
output: { // 输出重构 打包编译后的 文件目录 文件名称 【模块名称.时间戳】
filename: `${filePath}[name]${Timestamp}.js`,
chunkFilename: `${filePath}[name]${Timestamp}.js`
},
},
}