Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vue-cli4配置问题 #3797

Open
xiaozhanghui opened this issue Sep 13, 2021 · 9 comments
Open

vue-cli4配置问题 #3797

xiaozhanghui opened this issue Sep 13, 2021 · 9 comments

Comments

@xiaozhanghui
Copy link
Contributor

xiaozhanghui commented Sep 13, 2021

@vue/[email protected]
"vux": "^2.10.1"
"@vux/loader": "^2.0.0-rc5",

module.exports = {
configureWebpack: config => {
require('@vux/loader').merge(config, {
plugins: ['vux-ui']
})
},
chainWebpack(config) {},
};
只要有chainWebpack 就报错 vux/src/components/cell/index.vue // COMMENT in ./src/components/index.js(mian.js import { Cell } from "vux";Vue.component("cell", Cell);)


前面问题定位有问题,测试环境
image

@caozhong1996
Copy link
Collaborator

修复可能需要一定的时间,你可以尝试下看能不能全部使用 configureWebpack 配置

@xiaozhanghui
Copy link
Contributor Author

xiaozhanghui commented Sep 14, 2021

其实我这边不光chainWebpack影响,我很多地方会引起这个错误,感觉是balbel版本对vux引入处理之后没有加“;“,导致下面正则匹配不上。技术和时间有限只能硬改@vux/loader。

我改了@vux/loader/src/libs/import-parser-v2.js
.code.replace(/\s//\sCOMMENT";/g, " /* this line is trasformed by vux-loader */).replace(/\s//\sCOMMENT"/g, " /* this line is trasformed by vux-loader */)
就可以了,改的很low,技术有限。但是我在本地改的,我们项目上线走自动化,还要搞私有库,希望早点修复

@caozhong1996
Copy link
Collaborator

我尽快搞一搞

@xuqihua
Copy link

xuqihua commented Sep 16, 2021

@caozhong1996 build不退出咋整? 感觉跟eslint有error或者warning就不退出

@caozhong1996
Copy link
Collaborator

@xiaozhanghui 老哥,麻烦你在项目的node_modules下手动修改@vux/loader这两个文件试试:

去掉 import-parser-v2.js 第21行的 .code.replace(/\s//\sCOMMENT";/g, " // this line is trasformed by vux-loader)
impicture_20210916_170302

去掉 babel-transform-imports 下 index.js 第147行的 + ' // COMMENT'
impicture_20210916_170446

然后重新运行下项目看行不行,可以的话我就再发一个新包

@xiaozhanghui
Copy link
Contributor Author

按你的改了(你第一张图少了一个.code),正常了。我创建了一个pr,你可以看下

@caozhong1996
Copy link
Collaborator

我更新了@vux/loader 2.1.0, vux 2.11.1现在也支持文件上传组件了

@xuqihua
Copy link

xuqihua commented Sep 18, 2021

@caozhong1996 build不退出咋整? 感觉跟eslint有error或者warning就不退出

我把eslint去掉了就整好了 JS真的是一门高深不可琢磨的语言

@caozhong1996
Copy link
Collaborator

@caozhong1996 build不退出咋整? 感觉跟eslint有error或者warning就不退出

我把eslint去掉了就整好了 JS真的是一门高深不可琢磨的语言

这个锅js不背,生态太混乱了。容易有奇奇怪怪的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants