123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- let targetUrl = 'http://admin.dayaedu.com'
- // let targetUrl = 'http://dyme.utools.club'
- // let targetUrl = 'http://192.168.3.27:8000' // 箭河
- // let targetUrl = 'http://192.168.3.48:8000'
- // let targetUrl = 'http://testadm.dayaedu.com/'
- // let targetUrl = 'https://mstuonline.dayaedu.com'
- // let version = '1.0.0'
- // webpack.prod.conf.js
- // const Version = new Date().getTime();
- // const Version = 20191227;
- module.exports = {
- publicPath: './',
- // outputDir: 'dist',
- // assetsDir: 'static',
- // outputDir: 'dist',
- // 调整内部的 webpack 配置。
- // 查阅 https://github.com/vuejs/vue-doc-zh-cn/vue-cli/webpack.md
- // chainWebpack: () => {},
- // transpileDependencies: ['webpack-dev-server/client'],
- chainWebpack: config => {
- config.devtool('inline-source-map')
- config.output.filename('[name].[hash].js').end();
- // // chunkHash
- // config.output.filename(`js/[name].[chunkhash].${Version}.js`).end();
- // config.output.chunkFilename(`js/[id].[chunkhash].${Version}.js`).end();
- // config.output.filename(`js/[name].[chunkhash].js`).end();
- // config.output.chunkFilename(`js/[id].[chunkhash].js`).end();
- // config.entry.app = ['babel-polyfill', './src/main.js']
- // config.resolve.symlinks(true)
- // config.plugin('html').tap(args => {
- // args[0].chunksSortMode = 'none'
- // return args
- // })
- config.plugin('html').tap(args => {
- args[0].minify = {
- removeAttributeQuotes: false
- }
- return args
- })
- },
- // eslint-loader 是否在保存的时候检查
- lintOnSave: true,
- // 是否使用包含运行时编译器的Vue核心的构建
- runtimeCompiler: false,
- // 生产环境 sourceMap
- productionSourceMap: false,
- configureWebpack: () => { },
- // 配置 webpack-dev-server 行为。
- devServer: {
- open: process.platform === 'darwin',
- host: '0.0.0.0',
- port: 9002,
- https: false,
- hotOnly: false,
- // 查阅 https://github.com/vuejs/vue-doc-zh-cn/vue-cli/cli-service.md#配置代理
- proxy: {
- '/contracts': {
- target: targetUrl,
- changeOrigin: true,
- ws: true,
- '^/contracts': '/contracts',
- xfwd: true
- },
- '/student-server': {
- target: targetUrl,
- changeOrigin: true,
- ws: true,
- '^/student-server': '/student-server',
- xfwd: true
- },
- '/api-cms': {
- target: targetUrl,
- changeOrigin: true,
- ws: true,
- '^/api-cms': '/api-cms',
- xfwd: true
- },
- '/api-student': {
- target: targetUrl,
- changeOrigin: true,
- ws: true,
- '^/api-student': '/api-student',
- xfwd: true
- },
- '/api-auth': {
- target: targetUrl,
- changeOrigin: true,
- ws: true,
- '^/api-auth': '/api-auth',
- xfwd: true
- },
- '/musicGroup': {
- target: targetUrl,
- changeOrigin: true,
- ws: true,
- '^/musicGroup': '/musicGroup',
- xfwd: true
- }
- }, // string | Object
- },
- css: {
- loaderOptions: {
- less: {
- modifyVars: {
- // red: '#03a9f4',
- blue: '#14928A',
- // orange: '#f08d49',
- // 'text-color': '#111'
- }
- }
- }
- },
- }
|