一引入antd的样式就报错 import 'antd/dist/antd.css';
来源:9-3 CSS模块化
慕工程8751554
2018-01-02
报错
bundle.js:67347 Uncaught Error: Module parse failed: Unexpected character '@' (14:0)
You may need an appropriate loader to handle this file type.
| /* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */
| /* stylelint-disable at-rule-no-unknown */
| @font-face {
| font-family: "Helvetica Neue For Number";
写回答
3回答
-
慕工程8751554
提问者
2018-01-02
var webpack =require('webpack'); var path= require('path'); module.exports={ context:__dirname+'/src', entry:"./js/root.js", module:{ loaders:[ { test:/\.js?$/, exclude:/(node_modules)/, loader:'babel-loader', query:{ presets:['react','es2015'] } }, { test:/\.css$/, loader:'style!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]__[hash:base64:5]' } ] }, output:{ path:__dirname+"/src", filename:"bundle.js" }, devServer: { host: '127.0.0.1', port: 8888, //contentBase: 'dist/', historyApiFallback: true } };
022018-01-02 -
Parry
2018-01-02
webpack 怎么配置 loader 的?可以贴下截图吗?
00 -
慕工程8751554
提问者
2018-01-02
antd引入正常。去掉样式, 可以运行。
00
相似问题