ant-design / antd-mobile-samples

antd-mobile samples
1.15k stars 1.09k forks source link

自定义主题编译失败 #40

Closed chenghaohao closed 7 years ago

chenghaohao commented 7 years ago

想请问下1.X的分支下的create-react-app demo是不能用了吗?是run eject之后的配置法。加入自定义主题会编译失败,试了多次都不行。 报错: Failed to compile.

./node_modules/antd-mobile/lib/icon/style/index.less Module build failed:

'use strict'; ^ Unrecognised input in E:\react\antd-mobile-samples\create-react-app\node_modules\antd-mobile\lib\style\themes\default.js (line 1, column 0)

silentcloud commented 7 years ago

node_modules\antd-mobile\lib\style\themes\default.js

看着像是你 webpack extension 没配对

chenghaohao commented 7 years ago

extensions: ['.web.js', '.js', '.json', '.web.jsx', '.jsx'],

exclude: [/.js$/, /.html$/, /.json$/, /.less$/, /.svg$/],

然后我把1.X分支上面的demo代码拉下来运行create-react-app的demo也是报这个错呢。。

silentcloud commented 7 years ago

ok 我 check 一下

silentcloud commented 7 years ago

我测试了没问题哈,主要也就是这行代码 https://github.com/ant-design/antd-mobile-samples/blob/1.x/create-react-app/config/webpack.config.dev.js#L244

@chenghaohao

chenghaohao commented 7 years ago

好的,谢谢了