62 lines
1.3 KiB
JavaScript
62 lines
1.3 KiB
JavaScript
/* eslint-disable import/extensions */
|
|
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
|
|
|
const path = require('path')
|
|
|
|
const pageMethod = require('./utils/getPages.js')
|
|
|
|
const pages = pageMethod.pages()
|
|
const configs = pageMethod.configs()
|
|
// const { interfaceUrl } = require('./src/config')
|
|
function resolve(dir) {
|
|
return path.join(__dirname, dir)
|
|
}
|
|
|
|
module.exports = {
|
|
pages,
|
|
publicPath: '/',
|
|
configureWebpack: {
|
|
plugins: [
|
|
new CopyWebpackPlugin(configs)
|
|
]
|
|
},
|
|
css: {
|
|
loaderOptions: {
|
|
less: {
|
|
javascriptEnabled: true, // old solution
|
|
// HERE is the difference!
|
|
lessOptions: {
|
|
javascriptEnabled: true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
chainWebpack: (config) => {
|
|
config.resolve.alias
|
|
.set('@', resolve('./src'))
|
|
.set('@/common', resolve('@/common'))
|
|
},
|
|
devServer: {
|
|
port: 8081,
|
|
headers: { 'Access-Control-Allow-Origin': '*' },
|
|
proxy: {
|
|
'/api': {
|
|
target: 'localhost:8080/',
|
|
changeOrigin: true,
|
|
pathRewrite: {
|
|
'^/api': ''
|
|
}
|
|
},
|
|
// '/api': {
|
|
// // target: 'https://qcwss.cloud.tencent.com/domain/ajax',
|
|
// target: interfaceUrl,
|
|
// ws: true,
|
|
// changeOrigin: true,
|
|
// pathRewrite: {
|
|
// '^/api': '', // rewrite path
|
|
// },
|
|
// }
|
|
}
|
|
}
|
|
}
|