airyland / vux-loader

hack into vue-loader
64 stars 37 forks source link

关于升级版本后 主题文件配置错误 #39

Closed showbestriven closed 6 years ago

showbestriven commented 6 years ago

因为功能需要将 vux的版本更新至 2.7.3 浏览器console 提示 [VUX] 抱歉,当前组件[cell]要求更新依赖 vux-loader@latest 于是升级了vux-loader@1.1.23

@* https: ;@theme-color: #01d081;@header-background-color: @theme-color;@header-title-color: #fff;@header-text-color: #FFF;@header-arrow-color: #FFF;@tabbar-text-active-color: @theme-color;@button-global-border-radius: 5px;@button-global-font-color: #FFFFFF;@button-global-margin-top: 15px;@button-global-height: 42px;@button-global-disabled-font-color: rgba(255,255,255,.6);@button-global-active-font-color: #ccc;@button-global-font-size: 18px;@button-warn-bg-color: #E64340;@button-warn-active-color: #CE3C39;@button-default-bg-color: #F8F8F8;@button-default-font-color: #000000;@button-default-active-bg-color: #DEDEDE;@button-default-disabled-font-color: rgba(0,0,0,.3);@button-default-disabled-bg-color: #F7F7F7;@button-default-active-font-color: rgba(0,0,0,.6);@button-primary-bg-color: @theme-color;@button-primary-active-bg-color: #01a667;@tab-text-disabled-color: #ddd;@tab-text-default-color: #666;@tab-text-active-color: @theme-color;@tab-bar-active-color: @theme-color; ^ Unrecognised input in E:\wisdom_city******\wxzhcs-v20170421-1.0.0\wx_wisdom_employee\src\views\message\messageCenter.vue (line 184, column 0) @ ./~/vue-style-loader!./~/css-loader?{"minimize":false,"sourceMap":false}!./~/vue-loader/lib/style-compiler?{"id":"data-v-40b03735","scoped":true,"hasInlineConfig":false}!./~/vux-loader/src/after-less-loader.js!./~/less-loader/dist?{'modifyVars':{'* https':'','theme-color':'#01d081','header-background-color':'@theme-color','header-title-color':'#fff','header-text-color':'#FFF','header-arrow-color':'#FFF','tabbar-text-active-color':'@theme-color','button-global-border-radius':'5px','button-global-font-color':'#FFFFFF','button-global-margin-top':'15px','button-global-height':'42px','button-global-disabled-font-color':'rgba(255,255,255,.6)','button-global-active-font-color':'#ccc','button-global-font-size':'18px','button-warn-bg-color':'#E64340','button-warn-active-color':'#CE3C39','button-default-bg-color':'#F8F8F8','button-default-font-color':'#000000','button-default-active-bg-color':'#DEDEDE','button-default-disabled-font-color':'rgba(0,0,0,.3)','button-default-disabled-bg-color':'#F7F7F7','button-default-active-font-color':'rgba(0,0,0,.6)','button-primary-bg-color':'@theme-color','button-primary-active-bg-color':'#01a667','tab-text-disabled-color':'#ddd','tab-text-default-color':'#666','tab-text-active-color':'@theme-color','tab-bar-active-color':'@theme-color'},'sourceMap':true}!./~/vux-loader/src/style-loader.js!./~/vue-loader/lib/selector.js?type=styles&index=0!./src/views/message/messageCenter.vue 4:14-1561 13:3-17:5 14:22-1569 @ ./src/views/message/messageCenter.vue @ ./src/router/routeOption.js @ ./src/router/router.js @ ./src/main.js @ multi ./build/dev-client ./src/main.js

所有页面模块均报错! 未升级版本前无问题 package.json "dependencies": { "fastclick": "^1.0.6", "vue": "^2.2.6", "vue-navigation": "^1.1.1", "vue-router": "^2.3.1", "vuex": "^2.3.1", "vuex-persistedstate": "^2.0.0", "vux": "^2.7.3" }, "devDependencies": { "autoprefixer": "^6.7.2", "babel-core": "^6.22.1", "babel-loader": "^6.2.10", "babel-plugin-transform-runtime": "^6.22.0", "babel-preset-env": "^1.3.2", "babel-preset-stage-2": "^6.22.0", "babel-register": "^6.22.0", "chalk": "^1.1.3", "connect-history-api-fallback": "^1.3.0", "copy-webpack-plugin": "^4.0.1", "css-loader": "^0.28.0", "eventsource-polyfill": "^0.9.6", "express": "^4.14.1", "extract-text-webpack-plugin": "^2.0.0", "file-loader": "^0.11.1", "friendly-errors-webpack-plugin": "^1.1.3", "html-webpack-plugin": "^2.28.0", "http-proxy-middleware": "^0.17.3", "less": "^2.7.2", "less-loader": "^4.0.3", "opn": "^4.0.2", "optimize-css-assets-webpack-plugin": "^1.3.0", "ora": "^1.2.0", "rimraf": "^2.6.0", "semver": "^5.3.0", "shelljs": "^0.7.6", "url-loader": "^0.5.8", "vue-loader": "^11.3.4", "vue-style-loader": "^2.0.5", "vue-template-compiler": "^2.2.6", "vux-loader": "^1.1.23", "webpack": "^2.3.3", "webpack-bundle-analyzer": "^2.2.1", "webpack-dev-middleware": "^1.10.0", "webpack-hot-middleware": "^2.18.0", "webpack-merge": "^4.1.0" }, node : v6.11.3

webpack base配置: module.exports = vuxLoader.merge(webpackConfig, { options: {}, plugins: ['vux-ui', 'duplicate-style', { name: 'less-theme', path: 'src/config/theme.less' }] }) vux-loader.conf.js: `var utils = require('./utils') var config = require('../config') var isProduction = process.env.NODE_ENV === 'production'

module.exports = { loaders: utils.cssLoaders({ sourceMap: isProduction ? config.build.productionSourceMap : config.dev.cssSourceMap, extract: isProduction }) } `

showbestriven commented 6 years ago

我将配置文件内的全局主题配置注释 仍然报这个错误 @* https: ; 错误是出在这个上面的吗

airyland commented 6 years ago

@* https: ; 这一句是什么作用?

showbestriven commented 6 years ago

我的theme.less里 并没有这项@ https: 配置 我全部注释掉了 还是会报这个错 @ https: ; ^ Unrecognised input in E:\wisdom_city**\wxzhcs-v20170421-

airyland commented 6 years ago

诡异。你更新到 1.1.24 试试。

showbestriven commented 6 years ago

家里没法弄, 得明天去公司看看 不好意思

showbestriven commented 6 years ago

@airyland 1,1,24更新的过滤代码生效了 然后控制台也有打印 [vux-loader] 疑似不合法命名,将被忽略:* https

然后问题产生的原因我也定位到了

是因为我在theme.less里有这么一段注释

image

我把 https:// 协议头去掉就没问题了。

不知道为何注释里的内容被解析到了

showbestriven commented 6 years ago

我估计还是loader里对于注释里的处理 对 协议头里的 双斜杠// 没做过滤

airyland commented 6 years ago

明白了,我再处理一下。

showbestriven commented 6 years ago

@airyland 辛苦了。 昨天出问题的时候也没注意到 注释里面去 :)