easy-webpack / core

An easy way to create configuration files for Webpack
MIT License
68 stars 6 forks source link

Facing issue in loading CUR type files #40

Closed mariaantony-gnanasekaran closed 7 years ago

mariaantony-gnanasekaran commented 7 years ago

I am currently using skeleton-esnext-webpack.In this index.html file ,I want to add an image of CUR type file. so I configured my webpack.config as given below

config = generateConfig(config,
  {
    module: {
      loaders: [
        {
          test: /\.(cur)(\?\S*)?$/,
          loader: 'url-loader?name=[name].[ext]&limit=10000'
        }
      ]
    }
  }
);

But unfortunately,I am getting error like this

WARNING in ./src/flower.cur
Module parse failed: E:\development\skeleton-navigation-1.1.2\skeleton-esnext-webpack\src\flower.cur Unexpected character ' ' (1:0)
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)
 @ ./src ^\.\/.*$
 @ ./~/aurelia-loader-webpack/dist/commonjs/aurelia-loader-webpack.js
 @ multi aurelia.

so please suggest me a solution to overcome from this problem.

niieani commented 7 years ago

did you solve your issue?

mariaantony-gnanasekaran commented 7 years ago

@niieani Yes ,I solved my issue by configuring webpack.config as

config = generateConfig(config,
  {
    module: {
      rules: [{
        test: /\.(png|gif|cur|jpg)$/, loader: 'url-loader', query: { limit: 8192 }
      }]
    }
  }
);
module.exports = stripMetadata(config)