问题描述
我正在尝试这样做(在工兵中):
<style global>
@import 'filepond-plugin-image-preview/dist/filepond-plugin-image-preview.css';
</style>
但是在前端获得 404。
还在导入 CSS 的模块中看到 404。
解决方法
You can easily import CSS directly from your node_modules folder using the webpack and the CSS Loader. This is superior to just copy-and-pasting the CSS code because it ensures that the CSS style you are using for your website will always be in sync with your version of the library
By Using (~) you can import the CSS from the Node Modules:-
@import "~package/css-stylesheet";
div {
background-image: url("~package/image.jpeg");
}