我正在使用React中的Electron。我有一个问题,即电子不能让我的自定义光标,但它与默认光标指针一样,进度等效果很好。这是光标我的CSS属性值:React的电子无法加载自定义光标
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配置文件的内容。你可能在那里有一个错误。 – TylerH
可能你的javascript试图加载PNG –
添加我的webpack配置文件内容 – gintoki27