12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- const path = require('path');
- var webpack = require('webpack');
- module.exports = {
- // 基本路径 直接使用 / 即可
- publicPath: '/',
- // 输出文件目录
- outputDir: process.env.NODE_ENV === 'production' ? 'dist' : 'devdist',
- // eslint-loader 是否在保存的时候检查
- lintOnSave: false,
- /**
- * webpack配置,see https://github.com/vuejs/vue-cli/blob/dev/docs/webpack.md
- **/
- configureWebpack: (config) => {
- config.resolve = { // 配置解析别名
- extensions: ['.js', '.json', '.vue'],
- alias: {
- '@': path.resolve(__dirname, './src'),
- 'public': path.resolve(__dirname, './public'),
- '@c': path.resolve(__dirname, './src/components'),
- 'common': path.resolve(__dirname, './src/common'),
- 'api': path.resolve(__dirname, './src/api'),
- 'views': path.resolve(__dirname, './src/views'),
- 'data': path.resolve(__dirname, './src/data'),
- },
- },
- plugins => {
- plugins.ProvidePlugin = {
- 'window.Quill': 'quill/dist/quill.js',
- 'Quill': 'quill/dist/quill.js'
- }
- }
- },
- chainWebpack: config => {
- config.plugin('provide').use(webpack.ProvidePlugin, [{
- 'window.Quill': 'quill'
- }])
- },
- // 生产环境是否生成 sourceMap 文件
- productionSourceMap: false,
- // css相关配置
- // use thread-loader for babel & TS in production build
- // enabled by default if the machine has more than 1 cores
- parallel: require('os').cpus().length > 1,
- /**
- * PWA 插件相关配置,see https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-pwa
- */
- pwa: {},
- // webpack-dev-server 相关配置
- devServer: {
- open: false, // 编译完成是否打开网页
- host: '0.0.0.0', // 指定使用地址,默认localhost,0.0.0.0代表可以被外界访问
- port: 8000, // 访问端口
- https: false, // 编译失败时刷新页面
- proxy: {
- '/api': {
- target: 'http://10.201.2.116/k3cloud/services/LTTCWebService.asmx/ReceiveBleachDyeGanttParam',
- changeOrigin: true,
- pathRewrite: {
- '^/api': ''
- }
- }
- },
- },
- /**
- * 第三方插件配置
- */
- pluginOptions: {},
- }
|