GithubHelp home page GithubHelp logo

Comments (6)

fireyy avatar fireyy commented on April 28, 2024

这个可以参照 ant.design的说明

from react-antd-admin.

jaryway avatar jaryway commented on April 28, 2024

不知什么原因,去掉true的双引号又好了。昨天试了好久都没成功:

{
    "presets": [
        ["env", { "modules": false }],
        "react",
        "stage-2"
    ],
    "plugins": ["lodash",
        "react-hot-loader/babel",
        "syntax-dynamic-import",
        "transform-runtime",
        "transform-decorators-legacy", ["import", [{ "libraryName": "antd", "libraryDirectory": "lib", "style": true }]]
    ],
    "env": {
        "test": {
            "presets": ["env", "react", "stage-2"]
        }
    }
}

from react-antd-admin.

jaryway avatar jaryway commented on April 28, 2024

我发现我的项目没有把antd的样式打包到css文件中,而你的项目却可以把antd的样式打包到css文件中。
你是做什么配置或者加了什么条件语句么?

from react-antd-admin.

fireyy avatar fireyy commented on April 28, 2024

我的配置是 "style": "css", 你可以提供一下你具体的配置吗,babel-plugin-import 似乎对 code split 支持不太好

from react-antd-admin.

jaryway avatar jaryway commented on April 28, 2024

不管是设为css还是true都是没有打包antd样式。
我是copy你的build、config的文件夹,webpack的配置一模一样,唯一不一样的是,我用的路由是异步加载的。
react-router-code-splitting
不知跟这个有没有关系呃!

from react-antd-admin.

fireyy avatar fireyy commented on April 28, 2024

关于 extract-text-webpack-plugin 和 webpack 的 code split 兼容,babel-plugin-import 有未解决bug, 可以跟踪一下 umijs/babel-plugin-import#130

from react-antd-admin.

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.