From 1ce1b525e7470ebaaeb0d5cd1e59bd905c1a7114 Mon Sep 17 00:00:00 2001 From: surprise <15810472099@163.com> Date: 星期二, 05 三月 2024 18:07:32 +0800 Subject: [PATCH] 代码更新 --- vue.config.js | 124 ++++++++++++++++++++--------------------- 1 files changed, 61 insertions(+), 63 deletions(-) diff --git a/vue.config.js b/vue.config.js index 12527b1..031f18d 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,70 +1,68 @@ -const path = require('path') - -const resolve = dir => { - return path.join(__dirname, dir) -} - -// 椤圭洰閮ㄧ讲鍩虹 -// 榛樿鎯呭喌涓嬶紝鎴戜滑鍋囪浣犵殑搴旂敤灏嗚閮ㄧ讲鍦ㄥ煙鐨勬牴鐩綍涓�, -// 渚嬪锛歨ttps://www.my-app.com/ -// 榛樿锛�'/' -// 濡傛灉鎮ㄧ殑搴旂敤绋嬪簭閮ㄧ讲鍦ㄥ瓙璺緞涓紝鍒欓渶瑕佸湪杩欐寚瀹氬瓙璺緞 -// 渚嬪锛歨ttps://www.foobar.com/my-app/ -// 闇�瑕佸皢瀹冩敼涓�'/my-app/' -const BASE_URL = process.env.NODE_ENV === 'production' - ? './' - : './' - +/* + * @Author: 鐜嬫棴 1377869194@qq.com + * @Date: 2023-05-08 13:52:20 + * @LastEditors: 鐜嬫棴 1377869194@qq.com + * @LastEditTime: 2023-05-08 14:17:30 + * @FilePath: \LFWEB_NEW\vue.config.js + * @Description: 杩欐槸榛樿璁剧疆,璇疯缃甡customMade`, 鎵撳紑koroFileHeader鏌ョ湅閰嶇疆 杩涜璁剧疆: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +const path = require("path") +const resolve = dir => path.join(__dirname, dir) module.exports = { - // Project deployment base - // By default we assume your app will be deployed at the root of a domain, - // e.g. https://www.my-app.com/ - // If your app is deployed at a sub-path, you will need to specify that - // sub-path here. For example, if your app is deployed at - // https://www.foobar.com/my-app/ - // then change this to '/my-app/' - publicPath: BASE_URL, - - // tweak internal webpack configuration. - // see https://github.com/vuejs/vue-cli/blob/dev/docs/webpack.md - chainWebpack: config => { - config.resolve.alias - .set('@', resolve('src')) - .set('@c', resolve('src/components')) - .set('@api', resolve('src/api')) - .set('@config', resolve('src/config')) - .set('@tools', resolve('src/components/tools')) - .set('@mixin', resolve('src/components/mixin')) - .set('@map', resolve('src/components/map')) - .set('@assets', resolve('src/assets')) + lintOnSave: false, + publicPath: "./", + devServer: { + host: "0.0.0.0", //鎸囧畾瑕佷娇鐢ㄧ殑 host + port: 12315, //鎸囧畾绔彛鍙蜂互渚﹀惉 + hotOnly: false, //鍚敤鐑ā鍧楁浛鎹紝鑰屾棤闇�椤甸潰鍒锋柊浣滀负鏋勫缓澶辫触鏃剁殑鍥為��銆� }, + configureWebpack: { + resolve: { + alias: { + "@": resolve("src"), + }, + }, + }, css: { loaderOptions: { - less: { - javascriptEnabled: true - } - } + postcss: { + plugins: [ + require("postcss-px-to-viewport")({ + unitToConvert: "px", // 闇�瑕佽浆鎹㈢殑鍗曚綅 + viewportWidth: 1920, // 瑙嗗彛瀹藉害锛岀瓑鍚屼簬璁捐绋垮搴� + unitPrecision: 5, // 绮剧‘鍒板皬鏁扮偣鍚庡嚑浣� + /** + * 灏嗕細琚浆鎹㈢殑css灞炴�у垪琛紝 + * 璁剧疆涓� * 琛ㄧず鍏ㄩ儴锛屽锛歔'*'] + * 鍦ㄥ睘鎬х殑鍓嶉潰鎴栧悗闈㈣缃�*锛屽锛歔'*position*']锛�*position* 琛ㄧず鎵�鏈夊寘鍚� position 鐨勫睘鎬э紝濡� background-position-y + * 璁剧疆涓� !xx 琛ㄧず涓嶅尮閰峹x鐨勯偅浜涘睘鎬э紝濡傦細['!letter-spacing'] 琛ㄧず闄や簡letter-spacing 灞炴�т箣澶栫殑鍏朵粬灞炴�� + * 杩樺彲浠ュ悓鏃朵娇鐢� ! 鍜� * 锛屽['!font*'] 琛ㄧず闄や簡font-size銆� font-weight ...杩欎簺涔嬪灞炴�т箣澶栫殑鍏朵粬灞炴�у悕澶撮儴鏄�榝ont鈥欑殑灞炴�� + * */ + propList: ["*"], + viewportUnit: "vw", // 闇�瑕佽浆鎹㈡垚涓虹殑鍗曚綅 + fontViewportUnit: "vw", // 闇�瑕佽浆鎹㈢О涓虹殑瀛椾綋鍗曚綅 + /** + * 闇�瑕佸拷鐣ョ殑閫夋嫨鍣紝鍗宠繖浜涢�夋嫨鍣ㄥ搴旂殑灞炴�у�间笉鍋氬崟浣嶈浆鎹� + * 璁剧疆涓哄瓧绗︿覆锛岃浆鎹㈠櫒鍦ㄥ仛杞崲鏃朵細蹇界暐閭d簺閫夋嫨鍣ㄤ腑鍖呭惈璇ュ瓧绗︿覆鐨勯�夋嫨鍣紝濡傦細['body']浼氬尮閰嶅埌 .body-class锛屼篃灏辨剰鍛崇潃.body-class瀵瑰簲鐨勬牱寮忚缃笉浼氳杞崲 + * 璁剧疆涓烘鍒欒〃杈惧紡锛屽湪鍋氳浆鎹㈠墠浼氬厛鏍¢獙閫夋嫨鍣ㄦ槸鍚﹀尮閰嶈姝e垯锛屽鏋滃尮閰嶏紝鍒欎笉杩涜杞崲锛屽[/^body$/]浼氬尮閰嶅埌 body 浣嗘槸涓嶄細鍖归厤鍒� .body + */ + selectorBlackList: [], + minPixelValue: 1, // 鏈�灏忕殑鍍忕礌鍗曚綅鍊� + mediaQuery: false, // 鏄惁杞崲濯掍綋鏌ヨ涓缃殑灞炴�у�� + replace: true, // 鏇挎崲鍖呭惈vw鐨勮鍒欙紝鑰屼笉鏄坊鍔犲洖閫� + /** + * 蹇界暐涓�浜涙枃浠讹紝濡�'node_modules' + * 璁剧疆涓烘鍒欒〃杈惧紡锛屽皢浼氬拷鐣ュ尮閰嶈姝e垯鐨勬墍鏈夋枃浠� + * 濡傛灉璁剧疆涓烘暟缁勶紝閭d箞璇ユ暟缁勫唴鐨勫厓绱犻兘蹇呴』鏄鍒欒〃杈惧紡 + */ + exclude: [], + landscape: false, // 鏄惁鑷姩鍔犲叆 @media (orientation: landscape)锛屽叾涓殑灞炴�у�兼槸閫氳繃妯睆瀹藉害鏉ヨ浆鎹㈢殑 + landscapeUnit: "vw", // 妯睆鍗曚綅 + landscapeWidth: 1334, // 妯睆瀹藉害 + }), + ], + }, + }, }, - - // 鎵撳寘鏃朵笉鐢熸垚.map鏂囦欢 - productionSourceMap: false, - - devServer: { - open: true, // 鑷姩鎵撳紑娴忚鍣� - // 杩欓噷鍐欎綘璋冪敤鎺ュ彛鐨勫熀纭�璺緞锛屾潵瑙e喅璺ㄥ煙锛屽鏋滆缃簡浠g悊锛岄偅浣犳湰鍦板紑鍙戠幆澧冪殑axios鐨刡aseUrl瑕佸啓涓� '' 锛屽嵆绌哄瓧绗︿覆 - proxy: 'http://www.example.com/api', - // Related: https://github.com/vuejs/vue-cli/issues/2051#issuecomment-449612956 - disableHostCheck: true - }, - - pluginOptions: { - // 'style-resources-loader': { - // preProcessor: 'less', - // patterns: [ - // path.resolve(__dirname, 'src/style/custom.less') // global custom less file. - // ] - // } - }, - lintOnSave: false } -- Gitblit v1.9.3