@vue/cli 3配置文件vue.config.js
- const webpack = require('webpack')
- const path = require('path')
- // const CompressionWebpackPlugin = require('compression-webpack-plugin');
- const productionGzipExtensions = ['js', 'css']
- module.exports = {
- // 基本路径
- publicPath: process.env.NODE_ENV === 'production' ? '/production-sub-path/' : './',
- // 输出文件目录
- outputDir: 'dist',
- // eslint-loader 是否在保存的时候检查
- pages: {
- index: {
- // page 的入口
- entry: 'src/dyreleaseweb/main.js',
- // 模板来源
- template: 'public/index.html',
- filename: 'index.html',
- favicon: 'public/logo.ico',
- // 当使用 title 选项时,
- // template 中的 title 标签需要是 <title><%= htmlWebpackPlugin.options.title %></title>
- title: '通稿稿件2.0',
- // 在这个页面中包含的块,默认情况下会包含
- // 提取出来的通用 chunk 和 vendor chunk。
- chunks: ['chunk-vendors', 'chunk-common', 'index']
- },
- topic: {
- // page 的入口
- entry: 'src/topic/main.js',
- // 模板来源
- template: 'public/topic.html',
- // 在 dist/index.html 的输出
- filename: 'topic.html',
- favicon: 'public/logo.ico',
- title: 'Topic Page',
- chunks: ['chunk-vendors', 'chunk-common', 'index']
- }
- // 当使用只有入口的字符串格式时,
- // 模板会被推导为 `public/subpage.html`
- // 并且如果找不到的话,就回退到 `public/index.html`。
- // 输出文件名会被推导为 `subpage.html`。
- // subpage: 'src/subpage/main.js'
- },
- chainWebpack: () => {},
- configureWebpack: {
- plugins: [
- new webpack.ProvidePlugin({
- $: 'jquery',
- jQuery: 'jquery',
- 'windows.jQuery': 'jquery'
- })
- ]
- },
- productionSourceMap: true,
- // css相关配置
- css: {
- // 是否使用css分离插件 ExtractTextPlugin
- extract: true,
- // 开启 CSS source maps?
- sourceMap: false,
- // css预设器配置项
- loaderOptions: {
- css: {
- },
- postcss: {
- /* ident: 'postcss',
- plugins: (loader) => [
- require('postcss-import')({ root: loader.resourcePath }),
- require('postcss-preset-env')(),
- require('cssnano')()
- ] */
- }
- },
- // 启用 CSS modules for all css / pre-processor files.
- modules: true // 去掉文件名中的 .module
- },
- // 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 > ,
- // webpack-dev-server 相关配置
- devServer: {
- open: process.platform === 'darwin',
- host: '10.10.0.102',
- port: ,
- https: false,
- hotOnly: false,
- proxy: {
- '/api': {
- target: 'http://10.10.0.102:9010/',
- ws: true,
- changeOrigin: true,
- pathRewrite: {
- '^/api': '/gateway'
- }
- },
- '/foo': {
- target: '<other_url>'
- }
- },
- before: app => {}
- },
- // 第三方插件配置
- pluginOptions: {
- // ...
- }
- // eslint-disable-next-line eol-last
- }
@vue/cli 3配置文件vue.config.js的更多相关文章
- [转]Vue CLI 3搭建vue+vuex 最全分析
原文地址:https://my.oschina.net/wangnian/blog/2051369 一.介绍 Vue CLI 是一个基于 Vue.js 进行快速开发的完整系统.有三个组件: CLI:@ ...
- Vue CLI 3搭建vue+vuex 最全分析
一.介绍 Vue CLI 是一个基于 Vue.js 进行快速开发的完整系统.有三个组件: CLI:@vue/cli 全局安装的 npm 包,提供了终端里的vue命令(如:vue create .vue ...
- Vue Cli 3:vue.config.js配置文件
Vue Cli 3生成的项目结构,没有build.config目录,而是使用vue.config.js来进行配置. vue.config.js 是一个可选的配置文件,如果项目的 (和 package. ...
- vue cli 中关于vue.config.js中chainWebpack的配置
Vue CLI 的官方文档上写:调整webpack配置最简单的方式就是在vue.config.js中的configureWebpack选项提供一个对象. Vue CLI 内部的 webpack 配置 ...
- vue --- 解读vue的中webpack.base.config.js
const path = require('path') const utils = require('./utils')// 引入utils工具模块,具体查看我的博客关于utils的解释,utils ...
- vue cli搭建的vue项目 不小心开了eslint 一直报黄色的警告
报错必须处理,警告也忍不了,发现在bulid -webpack.base.config.js 里找到 const createLintingRule = () => ({ /*test: /\. ...
- 使用Vue CLI脚手架搭建vue项目
本次是使用@vue/cli 3.11.0版本搭建的vue项目 1. 首先确保自己的电脑上的Node.js的版本是8.9版本或者以上 2. 全局安装vue/cli npm install @vue/cl ...
- Vue CLI UI:Vue开发者必不可少的工具
突然发现一个Vue cli 比较好用的工具,一个可视化图形界面方便你去创建.更新和管理Vue项目.这里分享2个作者写得比较好的文章 https://codeseeding.com/portal.php ...
- webpack 4.0 配置文件 webpack.config.js文件的放置位置
一般webpack.config.js是默认放在根目录的,不在根目录的时候需要在package.json中制定位置,我的配置文件目录是config/webpack.config.js,在package ...
随机推荐
- MyBatis—mybatis-config.xml配置介绍
在定义sqlSessionFactory时需要指定MyBatis主配置文件: Xml代码 说明: 收藏代码 1. <bean id="sqlSessionFactory" ...
- python实现指定目录下批量文件的单词计数:并发版本
在 文章 <python实现指定目录下批量文件的单词计数:串行版本>中, 总体思路是: A. 一次性获取指定目录下的所有符合条件的文件 -> B. 一次性获取所有文件的所有文件行 - ...
- 打开 EXCEL时出现RUN-TIME ERROR“91”,怎么解决?
方法一: 开始—程序—microsoft—打开“windows office 2007 简易设置”,把“使用 office 03样式经典菜单”前的“√”去掉就OK了 方法二: 1. 打开注册表编辑器. ...
- 在使用swiper时,解决同一个页面使用多个轮播出现问题做法
$(".swiper-container").each(function(){ $(this).swiper({ loop: true, initialSlide :0, pagi ...
- zabbix-2.4.7环境部署与初始化安装
一.zabbix简介: zabbix的特点: - 安装与配置简单,学习成本低 - 支持多语言(包括中文) - 免费开源 - 自动发现服务器与网络设备 - 分布式监视以及WEB集中管理功能 - 可以无a ...
- 20135302魏静静——Linux课程期中总结
Linux期中总结 Linux课程第一周实验及总结:[http://www.cnblogs.com/20135302wei/p/5218607.html] 冯诺依曼体系结构的核心思想是存储程序计算机. ...
- 20145211黄志远 《网络对抗》Exp7 网络欺诈技术防范
20145211黄志远 <网络对抗>Exp7 网络欺诈技术防范 本实践的目标理解常用网络欺诈背后的原理,以提高防范意识,并提出具体防范方法.具体有(1)简单应用SET工具建立冒名网站(2) ...
- QT+VS中ui不能声明为指针?
问题描述:QtCreator里的UI全是默认为指针类型,调用的时候[ui->]但是使用VS+Qt来,发来默认的是变量类型,使用的时候[ui.] 统一:为了统一我把后者声明改为前者 问题:在mai ...
- autofac &web api 切换数据库
https://stackoverflow.com/questions/24188025/is-there-another-way-of-changing-database-instance-in-a ...
- POJ 1386 Play on Words(欧拉路)
http://poj.org/problem?id=1386 题意: 给出多个单词,只有单词首字母与上一个单子的末尾字母相同时可以连接,判断所有字母是否可以全部连接在一起. 思路: 判断是否存在欧拉道 ...