0
我試圖導入CSS文件在我的陣營項目像這樣:的WebPack CSS加載器無法加載某些路徑
import 'react-select/dist/react-select.css';
和失敗與錯誤:
ERROR in ./node_modules/react-select/dist/react-select.css
Module parse failed: /Users/1111/_projects/getmybot/getmybot/node_modules/react-select/dist/react-select.css Unexpected token (8:0)
You may need an appropriate loader to handle this file type.
| * MIT License: https://github.com/JedWatson/react-select
| */
| .Select {
| position: relative;
| }
@ ./frontend/integration-layer-editor.js 13:0-45
然而,當我同一個文件複製到我的應用程序文件夾中的一切suddently開始工作:
import './react-select.css';
輸出:
Asset Size Chunks Chunk Names
integration-layer-editor.bundle.js 886 kB 0 [emitted] [big] integration-layer-editor
[93] ./frontend/integration-layer-editor.js 740 bytes {0} [built]
[200] ./frontend/react-select.css 920 bytes {0} [built]
[201] ./node_modules/css-loader!./frontend/react-select.css 9.56 kB {0} [built]
這是怎麼發生的?
你是對的,我在我的CSS加載器配置中有一個'exclude:/ node_modules /'。謝謝! – kurtgn