分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 网页技术

vue-cli webpack config index.js 配置注释

发布时间:2023-09-06 01:55责任编辑:熊小新关键词:js配置webpack
var path = require(‘path‘) ???module.exports = { ???build: { // production 环境 ?????env: require(‘./prod.env‘), // 使用 config/prod.env.js 中定义的编译环境 ?????index: path.resolve(__dirname, ‘../dist/index.html‘), // 编译输入的 index.html 文件 ?????assetsRoot: path.resolve(__dirname, ‘../dist‘), // 编译输出的静态资源路径 ?????assetsSubDirectory: ‘static‘, // 编译输出的二级目录 ?????assetsPublicPath: ‘/‘, // 编译发布的根目录,可配置为资源服务器域名或 CDN 域名 ???productionSourceMap: true, // 是否开启 cssSourceMap ????// Gzip off by default as many popular static hosts such as ????// Surge or Netlify already gzip all static assets for you. ????// Before setting to `true`, make sure to: ????// npm install --save-dev compression-webpack-plugin ????productionGzip: false, // 是否开启 gzip ????productionGzipExtensions: [‘js‘, ‘css‘] // 需要使用 gzip 压缩的文件扩展名 ??}, ??dev: { // dev 环境 ????env: require(‘./dev.env‘), // 使用 config/dev.env.js 中定义的编译环境 ????port: 8080, // 运行测试页面的端口 ????assetsSubDirectory: ‘static‘, // 编译输出的二级目录 ????assetsPublicPath: ‘/‘, // 编译发布的根目录,可配置为资源服务器域名或 CDN 域名 ????proxyTable: {}, // 需要 proxyTable 代理的接口(可跨域) ????// CSS Sourcemaps off by default because relative paths are "buggy" ????// with this option, according to the CSS-Loader README ????// (https://github.com/webpack/css-loader#sourcemaps) ????// In our experience, they generally work as expected, ????// just be aware of this issue when enabling this option. ????cssSourceMap: false // 是否开启 cssSourceMap ??} }

vue-cli webpack config index.js 配置注释

原文地址:https://www.cnblogs.com/shkj/p/9063321.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved