2017-12-10 3 views
1

Ich implementiere Webpack in eckigen ohne CLI.Webpack und Angular 4 ohne CLI

Verzeichnisbaum:

  • aplication
  • -app
  • --directive
  • --services
  • - Modelle
  • --Mehr ... -assets -build - webpack conf
  • -src

webpack konfigurieren

Befehl NPM RUN ART wirft

ERROR in Error: Child compilation failed: 
    Entry module not found: Error: Can't resolve 'E:\index.html' in 'E:\cms s': 
    Error: Can't resolve 'E:\index.html' in 'E:\cms' 

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

    - Compiler.js:296 Compiler.<anonymous> 
    [cms_authors]/[webpack]/lib/Compiler.js:296:10 

    - Compiler.js:499 
    [cms_authors]/[webpack]/lib/Compiler.js:499:13 

    - Tapable.js:202 next 
    [cms_authors]/[tapable]/lib/Tapable.js:202:11 

    - CachePlugin.js:62 Compiler.<anonymous> 
    [cms_authors]/[webpack]/lib/CachePlugin.js:62:5 

    - Tapable.js:206 Compiler.applyPluginsAsyncSeries 
    [cms_authors]/[tapable]/lib/Tapable.js:206:13 

    - Compiler.js:496 
    [cms_authors]/[webpack]/lib/Compiler.js:496:10 

    - Tapable.js:195 Compilation.applyPluginsAsyncSeries 
    [cms_authors]/[tapable]/lib/Tapable.js:195:46 

    - Compilation.js:649 self.applyPluginsAsync.err 
    [cms_authors]/[webpack]/lib/Compilation.js:649:19 

    - Tapable.js:195 Compilation.applyPluginsAsyncSeries 
    [cms_authors]/[tapable]/lib/Tapable.js:195:46 

    - Compilation.js:640 self.applyPluginsAsync.err 
    [cms_authors]/[webpack]/lib/Compilation.js:640:11 

    - Tapable.js:202 next 
    [cms_authors]/[tapable]/lib/Tapable.js:202:11 

    - UglifyJsPlugin.js:230 Compilation.compilation.plugin 
    [cms_authors]/[webpack]/lib/optimize/UglifyJsPlugin.js:230:5 

    - Tapable.js:206 Compilation.applyPluginsAsyncSeries 
    [cms_authors]/[tapable]/lib/Tapable.js:206:13 

    - Compilation.js:635 self.applyPluginsAsync.err 
    [cms_authors]/[webpack]/lib/Compilation.js:635:10 

    - Tapable.js:195 Compilation.applyPluginsAsyncSeries 
    [cms_authors]/[tapable]/lib/Tapable.js:195:46 

ERROR in Entry module not found: Error: Can't resolve 'E:\cms_authors\app\systemjs.config.js' in 'E:\cms' 

ERROR in ./app/_services/hash.service.ts 
Module not found: Error: Can't resolve 'sha256' in 'E:\cms_authors\app\_services' 
@ ./app/_services/hash.service.ts 10:0-17 
@ ./app/_services/index.ts 
@ ./app/app.module.ts 
@ ./app/main.ts 

ERROR in ./app/_directives/article/preview.component.html?v=${new Date().getTime()} 
Module not found: Error: Can't resolve './assets/images/phone_image.png' in 'E:\cms\app\_directives\article' 
@ ./app/_directives/article/preview.component.html?v=${new Date().getTime()} 1:2388-2430 
@ ./app/_directives/article/preview.component.ts 
@ ./app/_directives/article/index.ts 
@ ./app/app.module.ts 
@ ./app/main.ts 

Antwort

0

Anscheinend ist der html webpack Plugin zum index.html bekommen ausfällt. Es ist nicht klar, wo sich die index.html in Ihrer Ordnerstruktur befindet. Schlagen Sie vor, den Wert HtmlWebpackPlugin.template zu einem korrekten Wert von index.html zu ändern. Im Fall, wenn es hilft, können Sie auf die Winkel verweisen mit webpack (dh ohne ng-cli) hier: https://github.com/rakcheru/webpack-angular5

0

fast :)

- building for production... 
[at-loader] Checking started in a separate process... 

[at-loader] Ok, 1.317 sec. 
Hash: 3be42f85ac92a975a792 
Version: webpack 2.5.1 
Time: 31485ms 
     Asset  Size Chunks Chunk Names 
    index.html 5.74 kB 
    vendor.js 2.23 MB  0 vendor 
    client.js 349 kB  1 client 
    styles.js 1.37 kB  2 styles 
client.js.gz 86.7 kB 
vendor.js.gz 444 kB 

WARNING in ./~/angular2-datatable/~/@angular/core/src/linker/system_js_ng_module_factory_loader.js 
71:15-36 Critical dependency: the request of a dependency is an expression 

WARNING in ./~/angular2-datatable/~/@angular/core/src/linker/system_js_ng_module_factory_loader.js 
87:15-102 Critical dependency: the request of a dependency is an expression 

ERROR in Error: Child compilation failed: 
    Module parse failed: M:\cms\assets\images\_logo_files\logo_small.png Unexpected character '�' (1:0) 
    You may need an appropriate loader to handle this file type. 
    (Source code omitted for this binary file): 
    SyntaxError: Unexpected character '�' (1:0) 

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

    - Compiler.js:296 Compiler.<anonymous> 
    [cms_authors]/[webpack]/lib/Compiler.js:296:10 

    - Compiler.js:499 
    [cms_authors]/[webpack]/lib/Compiler.js:499:13 

    - Tapable.js:202 next 
    [cms_authors]/[tapable]/lib/Tapable.js:202:11 

    - CachePlugin.js:62 Compiler.<anonymous> 
    [cms_authors]/[webpack]/lib/CachePlugin.js:62:5 

    - Tapable.js:206 Compiler.applyPluginsAsyncSeries 
    [cms_authors]/[tapable]/lib/Tapable.js:206:13 

    - Compiler.js:496 
    [cms_authors]/[webpack]/lib/Compiler.js:496:10 

    - Tapable.js:195 Compilation.applyPluginsAsyncSeries 
    [cms_authors]/[tapable]/lib/Tapable.js:195:46 

    - Compilation.js:649 self.applyPluginsAsync.err 
    [cms_authors]/[webpack]/lib/Compilation.js:649:19 

    - Tapable.js:195 Compilation.applyPluginsAsyncSeries 
    [cms_authors]/[tapable]/lib/Tapable.js:195:46 

    - Compilation.js:640 self.applyPluginsAsync.err 
    [cms_authors]/[webpack]/lib/Compilation.js:640:11 

    - Tapable.js:202 next 
    [cms_authors]/[tapable]/lib/Tapable.js:202:11 

    - UglifyJsPlugin.js:230 Compilation.compilation.plugin 
    [cms_authors]/[webpack]/lib/optimize/UglifyJsPlugin.js:230:5 

    - Tapable.js:206 Compilation.applyPluginsAsyncSeries 
    [cms_authors]/[tapable]/lib/Tapable.js:206:13 

    - Compilation.js:635 self.applyPluginsAsync.err 
    [cms_authors]/[webpack]/lib/Compilation.js:635:10 

    - Tapable.js:195 Compilation.applyPluginsAsyncSeries 
    [cms_authors]/[tapable]/lib/Tapable.js:195:46 



ERROR in ./app/_services/hash.service.ts 
Module not found: Error: Can't resolve 'sha256' in 'M:\cms\app\_services' 
@ ./app/_services/hash.service.ts 10:0-17 
@ ./app/_services/index.ts 
@ ./app/app.module.js 
+0

Sie müssen 1. Installieren und Konfigurieren von 'file-loader' für images ref: https://webpack.js.org/loaders/file-loader/#usage 2. npm installieren 'sha256'. Beachten Sie, dass 'sha256' veraltet ist. –