代码之家  ›  专栏  ›  技术社区  ›  gintoki27

React的Electron无法加载自定义光标

  •  1
  • gintoki27  · 技术社区  · 7 年前

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

    这是我的错误消息:

    0]中出错/app/images/common/icon_-cut。巴布亚新几内亚
    [0]模块解析失败:/Users/cuong/ops/ecode/skill share/app/images/common/icon\u cut。png意外字符“”(1:0)
    [0]您可能需要适当的加载程序来处理此文件类型。

    这是我的网页配置

    '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..)
      ]
    };
    

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

    1 回复  |  直到 7 年前
        1
  •  2
  •   TylerH Tim Pietzcker    7 年前

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