Giter Club home page Giter Club logo

Comments (5)

guozhaolong avatar guozhaolong commented on June 2, 2024

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

from wfd-vue.

qinzitong avatar qinzitong commented on June 2, 2024

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

from wfd-vue.

qinzitong avatar qinzitong commented on June 2, 2024

我的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"]
}
}
}

from wfd-vue.

guozhaolong avatar guozhaolong commented on June 2, 2024

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

from wfd-vue.

qinzitong avatar qinzitong commented on June 2, 2024

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

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

from wfd-vue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.