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

貌似less无效果? #24

Closed
codering opened this issue Dec 20, 2016 · 5 comments
Closed

貌似less无效果? #24

codering opened this issue Dec 20, 2016 · 5 comments
Labels

Comments

@codering
Copy link
Contributor

.roadhogrc

{
    "disableCSSModules": true,
    "less": true,
    "autoprefixer": {
        "browsers": [
            "last 4 versions",
            "Firefox ESR",
            "> 1%",
            "ie >= 8",
            "iOS >= 8",
            "Android >= 4"
        ]
    }
}

index.less

.box {
    background: red;
}

index.js

import './index.html'
import './index.less'

import React, {Component} from 'react'
import ReactDOM from 'react-dom'

class App extends Component {

    componentDidMount() {
     
    }
    
    render() {
        return (
                <div className="box">
                    测试
                </div>
        )
    }
} 

 ReactDOM.render( <App />, document.getElementById('root'))
@sorrycc sorrycc added the bug label Dec 20, 2016
@sorrycc
Copy link
Owner

sorrycc commented Dec 20, 2016

排查了好久,被这个 fallback loader 给坑到了。。

@codering
Copy link
Contributor Author

@sorrycc 能否发个小版本? 辛苦了!

@sorrycc
Copy link
Owner

sorrycc commented Dec 20, 2016

0.2.2

@codering
Copy link
Contributor Author

codering commented Dec 21, 2016

@sorrycc 如果使用antd 的Table组件 且 启用 less ,启动时就会报错
环境: ubuntu 16.04 或 win7

Failed to compile.

Error in ./~/antd/lib/checkbox/style/index.css
Module build failed: media definitions require block statements after any features
 @ /home/justin/work/fe_work/demo-learn/node_modules/antd/lib/checkbox/style/index.css (line 128, column 7)
 near lines:
   }
   @media \0screen {
     .ant-checkbox-checked .ant-checkbox-inner:before,
 @ ./~/antd/lib/checkbox/style/index.css 4:14-389 13:2-17:4 14:20-395

Error in ./~/antd/lib/spin/style/index.css
Module build failed: Unrecognised input
 @ /home/justin/work/fe_work/demo-learn/node_modules/antd/lib/spin/style/index.css (line 70, column 24)
 near lines:
     filter: blur(1px);
     -webkit-filter: progid\:DXImageTransform\.Microsoft\.Blur(PixelRadius\=1, MakeShadow\=false);
             filter: progid\:DXImageTransform\.Microsoft\.Blur(PixelRadius\=1, MakeShadow\=false);
 @ ./~/antd/lib/spin/style/index.css 4:14-389 13:2-17:4 14:20-395

把less设置改为false,就没问题

.roadhogrc

{
    "disableCSSModules": true,
    "less": true,
    "autoprefixer": {
        "browsers": [
            "last 4 versions",
            "Firefox ESR",
            "> 1%",
            "ie >= 8",
            "iOS >= 8",
            "Android >= 4"
        ]
    },
    "extraBabelPlugins": [
        "transform-runtime",
        ["import", { "libraryName": "antd", "libarayDirectory": "lib", "style": "css" }]
    ],
}

@sorrycc
Copy link
Owner

sorrycc commented Dec 21, 2016

已发 0.2.3,内置支持 less 并修复这个问题,然后不用设 "less": true 了。

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

No branches or pull requests

2 participants