lbassin / electron-angular-webpack Goto Github PK
View Code? Open in Web Editor NEWA simple kit for Electron, Angular 6 and Webpack 4 including a live reload system for Angular.
License: MIT License
A simple kit for Electron, Angular 6 and Webpack 4 including a live reload system for Angular.
License: MIT License
Because Native app is amazing! So, i would like to add this feature but it seems a little difficult for automatically building/packing via npm scripts
.
Follow this article to Integrate Native Node.js Modules Into an Electron App but i can not configure the scripts. Can you two investigate this request?
Thanks!
i had various compile issues with using old libraries
Missing:
npm install --save @angular/cli
to use ng g
commandangular.json
cli configuration file as created by ng new Error:
When adding a new component the corresponding html-file is not found in dev-mode.
To Reproduce:
ng g component test
npm run dev
See Error in Console:
GET http://127.0.0.1:4200/test.component.html 404 (Not Found)
Hi @lbassin
I want to create installer with only packed and minified code in dist
folder. But when install application, it contains and extracts the source code src
of project.
I dont want distribute the original code to customer. How can i exclude the src
folder?
Here below is my application after installation.
Thank you.
When I try to generate a new component in the project, I get this error:
Local workspace file ('angular.json') could not be found.
Where do I get the angular.json file?
'cross-env' is not recognized as an internal or external command, operable program or batch file
Error: Cannot find module 'webpack'
Error: Cannot find module 'webpack-cli/bin/config-yargs'
Error: Cannot find module 'neo-async'
2018-05-14T04_21_32_767Z-debug.log
2018-05-14T04_23_18_003Z-debug.log
2018-05-14T04_03_13_894Z-debug.log
2018-05-14T04_10_42_183Z-debug.log
2018-05-14T04_08_18_245Z-debug.log
2018-05-14T04_01_44_831Z-debug.log
2018-05-14T04_24_09_445Z-debug.log
Just wanted to say thankyou.
Je n'arrive pas à faire l'installation
For large application that we have many components and modules. So I hope this boilerplate has an option to enable code splitting and lazy loading.
Here is a guide: https://toddmotto.com/lazy-loading-angular-code-splitting-webpack
When cloning project an runing npm install
the spec
-files cannot be compiled.
Add npm install --save-dev @types/jasmine
and push project
Hi @lbassin
npm run dev (all ok!)
..omissis...
Entrypoint undefined = index.html
[0] ./node_modules/html-webpack-plugin/lib/loader.js!./src/index.hbs 833 bytes {0} [built]
[1] ./node_modules/underscore-template-loader/file-loader.js?url=global.scss!./src/global.scss 67 bytes {0} [built]
「wdm」: Compiled successfully.
ALL OK!
npm run prod
[7] ./src/main.ts 302 bytes {1} [built]
[213] ./src/app/app.module.ts 7.46 KiB {1} [built]
[223] ./src/app/app.component.ts 1.77 KiB {1} [built]
[224] ./src/app/providers/electron.service.ts 1.93 KiB {1} [built]
[227] ./src/app/app.icons.module.ts 1.25 KiB {1} [built]
[232] ./src/app/services/app.service.ts 15.6 KiB {1} [built]
[235] ./src/app/batch/batch.component.ts 11.4 KiB {1} [built]
[236] ./src/app/services/report.service.ts 24.4 KiB {1} [built]
[365] ./src/app/services/data.service.ts 20.2 KiB {1} [built]
[469] ./src/app/formly/typeahead-type.component.ts 3.09 KiB {1} [built]
+ 538 hidden modules
Child html-webpack-plugin for "index.html":
Asset Size Chunks Chunk Names
global.0c971e08a5.css 148 KiB [emitted]
+ 1 hidden asset
[0] ./node_modules/html-webpack-plugin/lib/loader.js!./src/index.hbs 833 bytes {0} [built]
[1] ./node_modules/underscore-template-loader/file-loader.js?url=global.scss!./src/global.scss 67 bytes {0} [built]
Dialog Box Error:
D:\PROGETTI\electron-angular-webpack\electron.js
Row: 2
'exports' undefined
Code : 800A1391
Thanks!
I only : clone, instal & run dev :/
Executing task: npm run dev <
[email protected] dev C:\electron\electron-angular-webpack
tsc electron.ts --outDir . && cross-env NODE_ENV=dev webpack-dev-server --port=4200
i 「wds」: Project is running at http://localhost:4200/
i 「wds」: webpack output is served from /
i 「wds」: 404s will fallback to /index.html
i 「wdm」: wait until bundle finished: /
× 「wdm」: Hash: fd6da217c01f71056371
Version: webpack 4.16.5
Time: 13119ms
Built at: 2018-08-20 13:18:15
Asset Size Chunks Chunk Names
index.html 2.33 KiB [emitted]
logo.14a6bdb2e1.png 81.3 KiB [emitted]
app.component.96c13c7ca7.html 99 bytes [emitted]
electron.js 697 KiB 0 [emitted] electron
corejs.js 1.27 MiB 1 [emitted] corejs
zonejs.js 1010 KiB 2 [emitted] zonejs
app.js 7.22 MiB 3 [emitted] app
package.json 2.71 KiB [emitted]
Entrypoint electron = electron.js
Entrypoint corejs = corejs.js
Entrypoint zonejs = zonejs.js
Entrypoint app = app.js
[1] multi (webpack)-dev-server/client?http://localhost:4200 ./electron 40 bytes {0} [built]
[2] (webpack)-dev-server/client?http://localhost:4200 7.78 KiB {0} {1} {2} {3} [built]
[4] ./node_modules/strip-ansi/index.js 161 bytes {0} {1} {2} {3} [built]
[6] ./node_modules/loglevel/lib/loglevel.js 7.68 KiB {0} {1} {2} {3} [built]
[17] (webpack)/hot/emitter.js 75 bytes {0} {1} {2} {3} [built]
[19] ./electron.ts 4.35 KiB {0} [built]
[21] external "path" 42 bytes {0} [built]
[23] multi (webpack)-dev-server/client?http://localhost:4200 core-js/client/shim 40 bytes {1} [built]
[24] ./node_modules/core-js/client/shim.js 233 KiB {1} [built]
[25] multi (webpack)-dev-server/client?http://localhost:4200 zone.js/dist/zone 40 bytes {2} [built]
[26] ./node_modules/zone.js/dist/zone.js 127 KiB {2} [built]
[27] multi (webpack)-dev-server/client?http://localhost:4200 ./src/main.ts 40 bytes {3} [built]
[28] ./src/main.ts 302 bytes {3} [built]
[29] ./node_modules/@angular/platform-browser-dynamic/fesm5/platform-browser-dynamic.js 20.2 KiB {3} [built]
[234] ./src/app/app.module.ts 1.25 KiB {3} [built]
+ 223 hidden modules
ERROR in ./src/app/app.component.scss
Module build failed (from ./node_modules/postcss-loader/src/index.js):
Error: Cannot find module 'autoprefixer'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object. (C:\electron\electron-angular-webpack\postcss.config.js:3:9)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at requireFromString (C:\electron\electron-angular-webpack\node_modules\require-from-string\index.js:28:4)
at parseJsFile (C:\electron\electron-angular-webpack\node_modules\cosmiconfig\dist\loadJs.js:15:15)
@ ./src/app/app.component.ts 17:24-55
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi (webpack)-dev-server/client?http://localhost:4200 ./src/main.ts
ERROR in Error: Child compilation failed:
Module build failed (from ./node_modules/postcss-loader/src/index.js):
Error: Cannot find module 'autoprefixer'
loader.js:581 Function.Module._resolveFilename
internal/modules/cjs/loader.js:581:15
loader.js:507 Function.Module._load
internal/modules/cjs/loader.js:507:25
loader.js:637 Module.require
internal/modules/cjs/loader.js:637:17
helpers.js:20 require
internal/modules/cjs/helpers.js:20:18
postcss.config.js:3 Object.
C:/electron/electron-angular-webpack/postcss.config.js:3:9
loader.js:689 Module._compile
internal/modules/cjs/loader.js:689:30
index.js:28 requireFromString
[electron-angular-webpack]/[require-from-string]/index.js:28:4
Error: Cannot find module 'autoprefixer'
compiler.js:79 childCompiler.runAsChild
[electron-angular-webpack]/[html-webpack-plugin]/lib/compiler.js:79:16
Compiler.js:296 compile
[electron-angular-webpack]/[webpack]/lib/Compiler.js:296:11
Compiler.js:553 hooks.afterCompile.callAsync.err
[electron-angular-webpack]/[webpack]/lib/Compiler.js:553:14
Hook.js:35 AsyncSeriesHook.lazyCompileHook [as _callAsync]
[electron-angular-webpack]/[tapable]/lib/Hook.js:35:21
Compiler.js:550 compilation.seal.err
[electron-angular-webpack]/[webpack]/lib/Compiler.js:550:30
Hook.js:35 AsyncSeriesHook.lazyCompileHook [as _callAsync]
[electron-angular-webpack]/[tapable]/lib/Hook.js:35:21
Compilation.js:1294 hooks.optimizeAssets.callAsync.err
[electron-angular-webpack]/[webpack]/lib/Compilation.js:1294:35
Hook.js:35 AsyncSeriesHook.lazyCompileHook [as _callAsync]
[electron-angular-webpack]/[tapable]/lib/Hook.js:35:21
Compilation.js:1285 hooks.optimizeChunkAssets.callAsync.err
[electron-angular-webpack]/[webpack]/lib/Compilation.js:1285:32
Hook.js:35 AsyncSeriesHook.lazyCompileHook [as _callAsync]
[electron-angular-webpack]/[tapable]/lib/Hook.js:35:21
Compilation.js:1280 hooks.additionalAssets.callAsync.err
[electron-angular-webpack]/[webpack]/lib/Compilation.js:1280:36
Child html-webpack-plugin for "index.html":
1 asset
Entrypoint undefined = index.html
[0] ./node_modules/html-webpack-plugin/lib/loader.js!./src/index.hbs 678 bytes {0} [built]
[1] ./node_modules/underscore-template-loader/file-loader.js?url=global.scss!./src/global.scss 785 bytes {0} [built] [failed] [1 error]
ERROR in ./src/global.scss (./node_modules/underscore-template-loader/file-loader.js?url=global.scss!./src/global.scss)
Module build failed (from ./node_modules/postcss-loader/src/index.js):
Error: Cannot find module 'autoprefixer'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (C:\electron\electron-angular-webpack\postcss.config.js:3:9)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at requireFromString (C:\electron\electron-angular-webpack\node_modules\require-from-string\index.js:28:4)
at parseJsFile (C:\electron\electron-angular-webpack\node_modules\cosmiconfig\dist\loadJs.js:15:15)
@ ./src/index.hbs (./node_modules/html-webpack-plugin/lib/loader.js!./src/index.hbs) 7:93-230
i 「wdm」: Failed to compile
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.