Git Product home page Git Product logo

Comments (3)

akFace avatar akFace commented on May 22, 2024

配置问题,解决了
1、安装babel插件: npm i babel-preset-stage-0 babel-plugin-component -D
2、安装weex-ui和weex-amui: npm i weex-ui -S 和 npm i weex-amui -S
3、在 .babelrc 文件中添加

{
    "presets": [
        "es2015",
        "stage-0"
    ],
    "plugins": [
        [
            "component",
            {
            "libraryName": "weex-amui",
            "libDir": "packages",
            "style": false
            }
            // 如果要和 weex-ui 一起用,配置加上下面这个
            ,{
            "libraryName": "weex-ui",
            "libDir": "packages",
            "style": false
            }
        ],
        ["transform-runtime", {
            "polyfill": false,
            "helpers": false
        }]
    ]
}

现在的问题是按需引入只对第一个起作用(无法同时对两个起作用),如果想weex-ui起作用就把它放到第一个

from eeui.

HOWAREYOUIAMFINE avatar HOWAREYOUIAMFINE commented on May 22, 2024

同时做到weex-ui和weex-amui按需引入,你需要修改 .babelrc文件如下:

{
    "presets": [
        "es2015",
        "stage-0"
    ],
    "plugins": [
        [
            "component",
            [
                {
                    "libraryName": "weex-amui",
                    "libDir": "packages",
                    "style": false
                },
                {
                    "libraryName": "weex-ui",
                    "libDir": "packages",
                    "style": false
                }
            ]
        ],
        [
            "transform-runtime",
            {
                "helpers": false,
                "polyfill": false
            }
        ]
    ]
}

这可能是因为“babel-pugin-component”的官方配置错误引起的,请看这个:同时按需引入两个组件,官方的配置报错,如何配置

使用eeui Demo项目在windows和mac环境下实测,均是可以做到weex-ui和weex-amui按需引入的

image

image

实际build出来的JS文件只有37kb左右

image

from eeui.

akFace avatar akFace commented on May 22, 2024

感觉是我的环境问题

from eeui.

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.