webpack图片的时候报错?

来源:3-7 webpack对icon-font和图片的处理

北斗神拳1984

2018-11-09

ERROR in ./src/image/banner1.jpg
Module build failed: Error: emitFile is required from module system
at Object.module.exports (/Users/shenjunwei/mall/doc/mall-fe/node_modules/file-loader/index.js:10:27)
at Object.loader (/Users/shenjunwei/mall/doc/mall-fe/node_modules/url-loader/dist/index.js:76:19)
@ ./~/css-loader!./src/page/index/index.css 7:206-240

写回答

2回答

北斗神拳1984

提问者

2018-11-09

shenjunweideMacBook-Pro:mall-fe shenjunwei$ cat package.json 

{

  "name": "mall-fe",

  "version": "1.0.0",

  "description": "mmall前端代码",

  "main": "index.js",

  "scripts": {

    "test": "echo \"Error: no test specified\" && exit 1"

  },

  "repository": {

    "type": "git",

    "url": "git@gitee.com:shenjw2018/mall-fe.git"

  },

  "author": "shenjw",

  "license": "ISC",

  "devDependencies": {

    "css-loader": "^1.0.1",

    "extract-text-webpack-plugin": "^1.0.1",

    "file-loader": "^0.11.1",

    "html-loader": "^0.5.5",

    "html-webpack-plugin": "^3.2.0",

    "style-loader": "^0.23.1",

    "url-loader": "^1.1.2",

    "webpack": "^1.15.0"

  },

  "dependencies": {}

}

装了,之前没装,提示

 Module build failed: Error: Cannot find module 'file-loader'


0
3
Rosen
回复
北斗神拳1984
收到!
2018-11-13
共3条回复

Rosen

2018-11-09

file-loader 没装?看看源代码里的 package.json文件跟你多有什么不一样

0
1
北斗神拳1984
shenjunweideMacBook-Pro:mall-fe shenjunwei$ cat package.json { "name": "mall-fe", "version": "1.0.0", "description": "mmall前端代码", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type": "git", "url": "git@gitee.com:shenjw2018/mall-fe.git" }, "author": "shenjw", "license": "ISC", "devDependencies": { "css-loader": "^1.0.1", "extract-text-webpack-plugin": "^1.0.1", "file-loader": "^0.11.1", "html-loader": "^0.5.5", "html-webpack-plugin": "^3.2.0", "style-loader": "^0.23.1", "url-loader": "^1.1.2", "webpack": "^1.15.0" }, "dependencies": {} }
2018-11-09
共1条回复

真实数据对接 从0开发前后端分离的企业级上线项目

【毕设项目精品】前端实战,对接真实服务端数据,开发完整项目

4262 学习 · 4113 问题

查看课程