guozhaolong / wfd-vue

flowable workflow designer for Vue base on @antv/g6
https://guozhaolong.github.io/wfd-vue/
1.01k stars 264 forks source link

将你的项目合到我的项目中 #17

Open guocong opened 4 years ago

guocong commented 4 years ago

我的项目: webpack:3.6 vue-loader:13.7 babel-loadder:7.1

因为你的项目webpack:4,vue-loader:15,babel-loader:8 导致如下问题 image

guozhaolong commented 4 years ago

好像错误是说不能解析...这种写法,是不是你的babel loader不对啊

qinzitong commented 4 years ago

我已出现过这样的问题, babel-loader的地方加上antv { test: /.js$/, loader: 'babel-loader', include: [resolve('src'), resolve('node_modules/@antv')], },

qinzitong commented 4 years ago

我的webpack也是 3.x系列,

babel-loader加上antv以后,报的错是 Error: Couldn't find preset "preset-env" relative to directory

.babel.rc 是这样的:

{ "compact": false, "presets": [ "es2015", ["env", { "modules": false, "targets": { "browsers": [ "> 1%", "last 2 versions", "not ie <= 8" ] } }], "stage-2" ], "plugins": ["transform-runtime", "transform-vue-jsx", "syntax-dynamic-import","transform-remove-strict-mode", ["import", { "libraryName": "ant-design-vue", "libraryDirectory": "es", "style": "css" }]], "env": { "test": { "presets": ["env", "stage-2"], "plugins": ["istanbul"] }, "development": { "presets": ["env", "stage-2"], "plugins": ["dynamic-import-node"] } } }

guozhaolong commented 4 years ago

哦,你是把源码合进去啊,vue的我还没试过。。。

qinzitong commented 4 years ago

哦,你是把源码合进去啊,vue的我还没试过。。。

我把源码打成了一个包,合到我们自己的项目了,所有的问题都解决了。一般问题是babel版本的问题,出现这种问题不是你的代码有问题,是没有把 antv的代码解析成es5的代码;升级到 babel 7 就可以了。