创建好login.html文件后,在git bash执行webpack出现错误

来源:3-6 webpack对html模板的处理

深色星空

2017-08-31

在view中创建好login.html文件后,将view文件夹中index.html里的代码复制到login.html,并在git bash中执行webpack,出现如下错误。


深色星空@MSI MINGW64 ~/mmall/doc/mmall-fe (mmall_v1.0)

$ webpack

Hash: b8f2030ddc00a484b045

Version: webpack 1.15.0

Time: 1078ms

           Asset       Size  Chunks             Chunk Names

      js/base.js    4.38 kB       0  [emitted]  common

     js/index.js  534 bytes       1  [emitted]  index

     js/login.js  435 bytes       2  [emitted]  login

   css/index.css  167 bytes       1  [emitted]  index

view/ index.html     3.4 kB          [emitted]

view/ login.html    3.32 kB          [emitted]

   [0] multi common 28 bytes {0} [built]

   [0] multi index 28 bytes {1} [built]

   [0] multi login 28 bytes {2} [built]

   [1] ./src/page/common/index.js 182 bytes {0} [built]

   [2] ./src/page/index/index.js 202 bytes {1} [built]

   [8] ./src/page/module.js 190 bytes {0} [built]

   [9] ./src/page/login/index.js 205 bytes {2} [built]

    + 5 hidden modules


ERROR in   Error: Child compilation failed:

  Entry module not found: Error: Cannot resolve 'file' or 'directory' C:\Users\深  色星空\mmall\doc\mmall-fe\src\view\ index.html in C:\Users\深色星空\mmall\doc\mmall-f  e:

  Error: Cannot resolve 'file' or 'directory' C:\Users\深色星空\mmall\doc\mmall-fe\s  rc\view\ index.html in C:\Users\深色星空\mmall\doc\mmall-fe


  - compiler.js:76

    [mmall-fe]/[html-webpack-plugin]/lib/compiler.js:76:16


  - Compiler.js:214 Compiler.<anonymous>

    [mmall-fe]/[webpack]/lib/Compiler.js:214:10


  - Compiler.js:403

    [mmall-fe]/[webpack]/lib/Compiler.js:403:12


  - Tapable.js:67 Compiler.next

    [mmall-fe]/[webpack]/[tapable]/lib/Tapable.js:67:11


  - CachePlugin.js:40 Compiler.<anonymous>

    [mmall-fe]/[webpack]/lib/CachePlugin.js:40:4


  - Tapable.js:71 Compiler.applyPluginsAsync

    [mmall-fe]/[webpack]/[tapable]/lib/Tapable.js:71:13


  - Compiler.js:400 Compiler.<anonymous>

    [mmall-fe]/[webpack]/lib/Compiler.js:400:9


  - Compilation.js:577 Compilation.<anonymous>

    [mmall-fe]/[webpack]/lib/Compilation.js:577:13


  - Tapable.js:60 Compilation.applyPluginsAsync

    [mmall-fe]/[webpack]/[tapable]/lib/Tapable.js:60:69


  - Compilation.js:572 Compilation.<anonymous>

    [mmall-fe]/[webpack]/lib/Compilation.js:572:10


  - Tapable.js:60 Compilation.applyPluginsAsync

    [mmall-fe]/[webpack]/[tapable]/lib/Tapable.js:60:69


  - Compilation.js:567 Compilation.<anonymous>

    [mmall-fe]/[webpack]/lib/Compilation.js:567:9


  - Tapable.js:60 Compilation.applyPluginsAsync

    [mmall-fe]/[webpack]/[tapable]/lib/Tapable.js:60:69


  - Compilation.js:563 Compilation.<anonymous>

    [mmall-fe]/[webpack]/lib/Compilation.js:563:8


  - Tapable.js:60 Compilation.applyPluginsAsync

    [mmall-fe]/[webpack]/[tapable]/lib/Tapable.js:60:69


  - Compilation.js:525 Compilation.seal

    [mmall-fe]/[webpack]/lib/Compilation.js:525:7


  - Compiler.js:397 Compiler.<anonymous>

    [mmall-fe]/[webpack]/lib/Compiler.js:397:15


  - Tapable.js:103

    [mmall-fe]/[webpack]/[tapable]/lib/Tapable.js:103:11


  - Compilation.js:445 Compilation.<anonymous>

    [mmall-fe]/[webpack]/lib/Compilation.js:445:10


  - Compilation.js:344 Compilation.errorAndCallback

    [mmall-fe]/[webpack]/lib/Compilation.js:344:3


  - Compilation.js:358 Compilation.<anonymous>

    [mmall-fe]/[webpack]/lib/Compilation.js:358:11


  - NormalModuleFactory.js:29 onDoneResolving

    [mmall-fe]/[webpack]/lib/NormalModuleFactory.js:29:20


  - NormalModuleFactory.js:85

    [mmall-fe]/[webpack]/lib/NormalModuleFactory.js:85:20


  - async.js:726

    [mmall-fe]/[webpack]/[async]/lib/async.js:726:13


  - async.js:52

    [mmall-fe]/[webpack]/[async]/lib/async.js:52:16


  - async.js:241 done

    [mmall-fe]/[webpack]/[async]/lib/async.js:241:17


  - async.js:44

    [mmall-fe]/[webpack]/[async]/lib/async.js:44:16


  - async.js:723

    [mmall-fe]/[webpack]/[async]/lib/async.js:723:17


  - async.js:167

    [mmall-fe]/[webpack]/[async]/lib/async.js:167:37


  - UnsafeCachePlugin.js:24

    [mmall-fe]/[webpack]/[enhanced-resolve]/lib/UnsafeCachePlugin.js:24:19




ERROR in   Error: Child compilation failed:

  Entry module not found: Error: Cannot resolve 'file' or 'directory' C:\Users\深  色星空\mmall\doc\mmall-fe\src\view\ login.html in C:\Users\深色星空\mmall\doc\mmall-f  e:

  Error: Cannot resolve 'file' or 'directory' C:\Users\深色星空\mmall\doc\mmall-fe\s  rc\view\ login.html in C:\Users\深色星空\mmall\doc\mmall-fe


  - compiler.js:76

    [mmall-fe]/[html-webpack-plugin]/lib/compiler.js:76:16


  - Compiler.js:214 Compiler.<anonymous>

    [mmall-fe]/[webpack]/lib/Compiler.js:214:10


  - Compiler.js:403

    [mmall-fe]/[webpack]/lib/Compiler.js:403:12


  - Tapable.js:67 Compiler.next

    [mmall-fe]/[webpack]/[tapable]/lib/Tapable.js:67:11


  - CachePlugin.js:40 Compiler.<anonymous>

    [mmall-fe]/[webpack]/lib/CachePlugin.js:40:4


  - Tapable.js:71 Compiler.applyPluginsAsync

    [mmall-fe]/[webpack]/[tapable]/lib/Tapable.js:71:13


  - Compiler.js:400 Compiler.<anonymous>

    [mmall-fe]/[webpack]/lib/Compiler.js:400:9


  - Compilation.js:577 Compilation.<anonymous>

    [mmall-fe]/[webpack]/lib/Compilation.js:577:13


  - Tapable.js:60 Compilation.applyPluginsAsync

    [mmall-fe]/[webpack]/[tapable]/lib/Tapable.js:60:69


  - Compilation.js:572 Compilation.<anonymous>

    [mmall-fe]/[webpack]/lib/Compilation.js:572:10


  - Tapable.js:60 Compilation.applyPluginsAsync

    [mmall-fe]/[webpack]/[tapable]/lib/Tapable.js:60:69


  - Compilation.js:567 Compilation.<anonymous>

    [mmall-fe]/[webpack]/lib/Compilation.js:567:9


  - Tapable.js:60 Compilation.applyPluginsAsync

    [mmall-fe]/[webpack]/[tapable]/lib/Tapable.js:60:69


  - Compilation.js:563 Compilation.<anonymous>

    [mmall-fe]/[webpack]/lib/Compilation.js:563:8


  - Tapable.js:60 Compilation.applyPluginsAsync

    [mmall-fe]/[webpack]/[tapable]/lib/Tapable.js:60:69


  - Compilation.js:525 Compilation.seal

    [mmall-fe]/[webpack]/lib/Compilation.js:525:7


  - Compiler.js:397 Compiler.<anonymous>

    [mmall-fe]/[webpack]/lib/Compiler.js:397:15


  - Tapable.js:103

    [mmall-fe]/[webpack]/[tapable]/lib/Tapable.js:103:11


  - Compilation.js:445 Compilation.<anonymous>

    [mmall-fe]/[webpack]/lib/Compilation.js:445:10


  - Compilation.js:344 Compilation.errorAndCallback

    [mmall-fe]/[webpack]/lib/Compilation.js:344:3


  - Compilation.js:358 Compilation.<anonymous>

    [mmall-fe]/[webpack]/lib/Compilation.js:358:11


  - NormalModuleFactory.js:29 onDoneResolving

    [mmall-fe]/[webpack]/lib/NormalModuleFactory.js:29:20


  - NormalModuleFactory.js:85

    [mmall-fe]/[webpack]/lib/NormalModuleFactory.js:85:20


  - async.js:726

    [mmall-fe]/[webpack]/[async]/lib/async.js:726:13


  - async.js:52

    [mmall-fe]/[webpack]/[async]/lib/async.js:52:16


  - async.js:241 done

    [mmall-fe]/[webpack]/[async]/lib/async.js:241:17


  - async.js:44

    [mmall-fe]/[webpack]/[async]/lib/async.js:44:16


  - async.js:723

    [mmall-fe]/[webpack]/[async]/lib/async.js:723:17


  - async.js:167

    [mmall-fe]/[webpack]/[async]/lib/async.js:167:37


  - UnsafeCachePlugin.js:24

    [mmall-fe]/[webpack]/[enhanced-resolve]/lib/UnsafeCachePlugin.js:24:19



Child html-webpack-plugin for "view\ index.html":


    ERROR in Entry module not found: Error: Cannot resolve 'file' or 'directory' C:\Users\深色星空\mmall\doc\mmall-fe\src\view\ index.html in C:\Users\深色星空\mmall\doc\mmall-fe

Child html-webpack-plugin for "view\ login.html":


    ERROR in Entry module not found: Error: Cannot resolve 'file' or 'directory' C:\Users\深色星空\mmall\doc\mmall-fe\src\view\ login.html in C:\Users\深色星空\mmall\doc\mmall-fe

Child extract-text-webpack-plugin:

        + 2 hidden modules


写回答

2回答

Rosen

2017-08-31

错误提示index.html找不到,是不是给弄丢了

1
6
Rosen
回复
深色星空
收到!继续加油!
2017-09-01
共6条回复

深色星空

提问者

2017-09-01

老师,回复里不能贴图,但是全贴代码不好检查,我就在这里贴图吧。webpack.config.js如下图。

//szimg.mukewang.com/59a8d14900019b7e16331028.jpg

//szimg.mukewang.com/59a8d1490001fa8916331028.jpg


0
0

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

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

4262 学习 · 4113 问题

查看课程