gpt4 book ai didi

css - 用于React的Electron无法加载自定义光标

转载 作者:行者123 更新时间:2023-12-03 12:24:38 25 4
gpt4 key购买 nike

我正在React中与Electron合作。我遇到了Electron无法获取自定义光标的问题,但是它可以与默认光标(例如指针,进度等)一起很好地工作。这是光标的CSS属性值:

 cursor: url('../../images/common/icon_cut.png');

这是我的错误信息:

0] ERROR in ./app/images/common/icon_cut.png
[0] Module parse failed: /Users/cuong/ops/ecode/skill-share/app/images/common/icon_cut.png Unexpected character '�' (1:0)
[0] You may need an appropriate loader to handle this file type. [0] SyntaxError: Unexpected character '�' (1:0)



这是我的webpack配置
'use strict';

const webpack = require('webpack');
const path = require('path');

module.exports = {
module: {
loaders: [{
test: /\.jsx?$/,
loaders: ['babel-loader'],
exclude: /node_modules/
}, {
test: /\.json$/,
loader: 'json-loader'
}]
},
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
libraryTarget: 'commonjs2'
},
resolve: {
extensions: ['', '.js', '.jsx'],
packageMains: ['webpack', 'browser', 'web', 'browserify', ['jam', 'main'], 'main']
},
plugins: [
new webpack.optimize.DedupePlugin(),
],
externals: [
// put your node 3rd party libraries which can't be built with webpack here
// (mysql, mongodb, and so on..)
]
};

有人知道我的问题的解决方案吗?

最佳答案

尝试将此加载​​程序添加到您的webpack配置文件中以测试.png支持:

{ test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000' }

关于css - 用于React的Electron无法加载自定义光标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46055028/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com