1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- const path = require('path')
- const version = new Date().getTime();
- module.exports = {
- lintOnSave: false,
- publicPath: './', // 基本路径
- outputDir: 'dist', // 输出文件目录
- assetsDir: './assets',
- productionSourceMap: false,
- transpileDependencies: ['@supermap/iclient-common', '@supermap/iclient-leaflet'],
- devServer: {
- host: '0.0.0.0', // can be overwritten by process.env.HOST
- port: 8088, // 端口配置
- proxy: {
- '/api': {
- target: 'http://localhost:9999/', // 服务器端接口地址
- ws: true, // 如果要代理 websockets,配置这个参数
- // 如果是https接口,需要配置这个参数
- changeOrigin: true, // 是否跨域
- pathRewrite: {
- '/api': 'ly/api'
- }
- }
- },
- overlay: {
- warnings: true,
- errors: false
- }
- },
- configureWebpack: {
- devtool: 'source-map',
- output: {
- sourcePrefix: " ",
- filename: `js/[name].${version}.js`,
- chunkFilename: `js/[name].${version}.js`
- },
- amd: {
- toUrlUndefined: true
- },
- resolve: {
- alias: {
- 'vue$': 'vue/dist/vue.esm.js',
- '@': path.resolve('src'),
- 'txml/txml': 'txml/dist/txml'
- }
- },
- plugins: [
- ],
- module: {
- unknownContextCritical: /^.\/.*$/,
- unknownContextCritical: false,
- exprContextCritical: false
- }
- },
- // 给css添加版本号
- // chainWebpack: config => {
- // config.plugin('extract-css').tap(args => [
- // {
- // filename: `assets/css/[name].${version}.css`,
- // chunkFilename: `assets/css/[name].${version}.css`
- // }
- // ])
- // }
- }
|