123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- 'use strict'
- const path = require('path')
- // const defaultSettings = require('./src/settings.js')
- function resolve(dir) {
- return path.join(__dirname, dir)
- }
- const port = process.env.port || process.env.npm_config_port || 9528
- module.exports = {
- publicPath: './',
- outputDir: 'dist',
- assetsDir: 'static',
- lintOnSave: process.env.NODE_ENV === 'development',
- productionSourceMap: false,
- devServer: {
- port: port,
- open: true,
- overlay: {
- warnings: false,
- errors: false
- },
- proxy: {
- '/admin': {
- target: 'https://haowan.4dkankan.com', // 正式环境
- // target: 'http://192.168.0.83:8165' // 伟玉本地环境
- // target: 'http://haowantest.4dkankan.com' // 测试环境
- },
- '/node-upload': {
- target: 'http://haowantest.4dkankan.com',
- },
- }
- // before: require('./mock/mock-server.js')
- },
- configureWebpack: {
- // provide the app's title in webpack's name field, so that
- // it can be accessed in index.html to inject the correct title.
- name: '好玩展-管理后台',
- resolve: {
- alias: {
- '@': resolve('src'),
- 'api': resolve('src/api'),
- 'libs': resolve('src/libs'),
- 'vue$': 'vue/dist/vue.esm.js',
- // 定义静态资源快捷路径
- 'assets': resolve('src/assets'),
- // 定义组建模块快捷路径
- 'components': resolve('src/components'),
- // 定义配置模块快捷路径
- 'config': resolve('src/config'),
- // 定义指令模块快捷路径
- 'directive': resolve('src/directive'),
- // 定义骨架模块快捷路径
- 'layout': resolve('src/layout'),
- // 定义插件模块快捷路径
- 'plugin': resolve('src/plugin'),
- // 定义注册模块快捷路径
- 'register': resolve('src/register'),
- // 定义路由模块快捷路径
- 'router': resolve('src/router'),
- // 定义仓库模块快捷路径
- 'store': resolve('src/store'),
- // 定义视图模块快捷路径
- 'views': resolve('src/views')
- }
- }
- },
- css: {
- loaderOptions: {
- // 给 less-loader 传递 Less.js 相关选项
- less: {
- javascriptEnabled: true
- }
- }
- }
- }
|