EasyUI Forum
June 19, 2024, 04:07:57 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Error Module parse failed: Unexpected character '  (Read 22085 times)
mapner
Jr. Member
**
Posts: 63


View Profile
« on: March 31, 2020, 02:41:35 PM »

Hello,

I get errors when I comple with webpack

ERROR in ./node_modules/vx-easyui/dist/themes/icons/filesave.png 1:0
Module parse failed: Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

my congif

package.json

{
  "name": "vue-jeasyui",
  "version": "1.0.0",
  "description": "vue-jeasyui",
  "main": "webpack.config.js",
  "scripts": {
    "clean": "rimraf dist",
    "build": "npm run clean && webpack --mode production",
    "serve": "webpack-dev-server --mode development",
    "test": "test"
  },
  "author": "MP",
  "license": "MIT",
  "devDependencies": {
    "@babel/core": "^7.9.0",
    "@babel/preset-env": "^7.9.0",
    "babel-loader": "^8.1.0",
    "css-loader": "^3.4.2",
    "html-webpack-plugin": "^4.0.3",
    "rimraf": "^3.0.2",
    "style-loader": "^1.1.3",
    "vue": "^2.6.11",
    "vue-loader": "^15.9.1",
    "vue-style-loader": "^4.1.2",
    "vue-template-compiler": "^2.6.11",
    "webpack": "^4.42.1",
    "webpack-cli": "^3.3.11",
    "webpack-dev-server": "^3.10.3"
  },
  "dependencies": {
    "vx-easyui": "^1.2.6"
  }
}

my webpack.config.js

const HtmlWebpackPlugin = require('html-webpack-plugin');
const VueLoaderPlugin = require('vue-loader/lib/plugin');

module.exports = {
  entry: './src/main.js',
  module: {
    rules: [
      { test: /\.js$/, use: 'babel-loader' },
      { test: /\.vue$/, use: 'vue-loader' },
      { test: /\.css$/, use: ['vue-style-loader', 'css-loader']},
    ]
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: './src/index.html',
    }),
    new VueLoaderPlugin(),
  ]
};

.babelrc.js

module.exports = {
    presets: ['@babel/preset-env']
  }


thanks
Logged
mapner
Jr. Member
**
Posts: 63


View Profile
« Reply #1 on: April 02, 2020, 03:35:37 PM »

solution:

{test: /\.(jpe?g|png|gif|svg)$/i, loader: "file-loader?name=app/images/[name].[ext]"},

you're welcome
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!