angular2-webpack-starter | Angular 2 Webpack starter project
kandi X-RAY | angular2-webpack-starter Summary
kandi X-RAY | angular2-webpack-starter Summary
Angular 2 Webpack starter project
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of angular2-webpack-starter
angular2-webpack-starter Key Features
angular2-webpack-starter Examples and Code Snippets
Community Discussions
Trending Discussions on angular2-webpack-starter
QUESTION
I am using Angular-Cli and I have updated all of my package.json using the ncu tool. Now when I do a npm start (webpack-dev-server --port 4200 --config config/webpack.dev.js --open --progress --profile --watch --content-base src/), webpack hangs at
webpack: wait until bundle finished: /
Is it possible to isolate the package causing the problem? I tried using display-error-details flag but it says it isnt recognized. I dont think it will help even if it is set. There is no error thrown, just asks you to wait indefinitely.
...ANSWER
Answered 2017-Oct-13 at 09:06I have similar problem for angular-starter and I was able to remove this bug after:
- upgrade node and npm to lastes versions (still error)
- remove node_modules
npm cache clean --force
npm install
(still error)npm rebuild node-sass --force
(still error)- and this is CRITICAL (surprisingly) : build app by
npm run build:aot
After this steps webpack: npm start
command start working properly and not hang.
QUESTION
on Sentry documentation thera are instructions to integrate sentry with Angular2 CLI, but there is a lack of instructions to integrate sentry with Angrular2-webpack-starter. How to do it properly?
...ANSWER
Answered 2017-Mar-18 at 17:36I give answer for latest version of angular2-webpack-starter from 8 March 2017 [55d4325]. In this solution, Sentry will be enabled only in production build (normal and AoT) for which it will also throw exceptions in console (but no so 'full featured' exception as are thrown by development builds). Instruction:
First go to project directory and in console run:
QUESTION
Please see the edit below
I have used the following package as a base for my VS Project -> https://github.com/AngularClass/angular2-webpack-starter
Everything worked nicely in Visual Studio code, I then tried to convert it to a Visual Studio 2017 Project (node.js web)
Now some problems appeared
VS seems to install TypeScript definitions into a special folder C:\Users\MyUser\AppData\Local\Microsoft\TypeScript\node_modules\@types
Additionally I included @types/node in my package.json which resulted in the appropriate node_modules folder.
now VS complains with error code TS4090 (Conflicting defintions for 'node').
Is there a possibility apart from deleting the folder in \AppData to tell VS which @types it should use?
The whole integration of TypeScript isn't really clear to me... Does MSBuild recognize an existing tsconfig.json? or would I have to configure it in in the project-file as seen here?
EDIT
I just noticed that I was actually editing a .js file. As soon as I changed the extension to .ts every warning and error vanished. I also got many typescript errors (like TS2307, can't find module '@angular/core') before changing the extension from .js to .ts
The file just did an import (from node)
...ANSWER
Answered 2017-Mar-22 at 02:58The definition files installed to C:\Users\MyUser\AppData\Local\Microsoft\TypeScript\node_modules\@types
are used for giving JavaScript IntelliSense only. If you have TypeScript in your project or a project configured with a tsconfig.json
, you need to fetch your own .d.ts
files and store them in your project. Luckily this project comes with all the .d.ts files you need already in the package.json
a simple npm install
should do the trick.
I can tell you that the conflicting definitions with 'node' are likely due to having 2 copies of the node.d.ts file. If you manually installed one yourself, on top of the one included in the projects package.json
, then you'll get those errors.
I'm not certain about the TS errors you are getting in your JavaScript file. Can you show me an example of one of the errors and a snippet of the code causing it?
Also you probably don't want integration with MSBuild as this project is already setup to run with npm scripts + webpack. You should check out this plugin: https://marketplace.visualstudio.com/items?itemName=MadsKristensen.NPMTaskRunner
Finally I don't think you want to be inside a Node.js web project. For this project, you are probably best off just opening the folder in VS. To do that just use File > Open > Folder...
and navigate to your root folder. This will give you all the editing tools you need without any MSBuild or VS project structure. Considering this project wasn't designed to take advantage of any of those features, it'll probably be easier just to ignore them for now.
Please let me know what other issues you run into.
QUESTION
Our project structure follows this: Angular2-webpack-starter.
Our project successfully compiles, build and can be seen in the browser. No problems here.
But when we try to run the test cases using karma and jasmine
we are getting this error.
ANSWER
Answered 2019-Jun-12 at 12:58The error is in your test bed configuration
QUESTION
During my experience in angular I was forced to use four different ways of include 3-rd party library poliglot.js (for multilang).
So to be able use new Polyglot(...)
in my Lang class:
ANSWER
Answered 2018-Aug-20 at 11:07So lets break it down:
A: Would still work in any angular version you just have to declare require before using it.
QUESTION
I'm using the Angular2/Angular4 to build the application and I'm getting these errors when I'm running command "npm install".
...ANSWER
Answered 2017-Jun-22 at 09:05Found the solution - there was the trick with the version of the angular packages. After updating to the last version everything's fine.
QUESTION
I wanted to start my angular2 app on webpack first time, and I get : ERROR in Path must be string. Received undefined webpack: failed to compile, that's the package.json`
...ANSWER
Answered 2017-Jul-27 at 15:19The issue is related with Node 6 and above. Changing it for Node 5.x instead will probably fix the issue.
QUESTION
In my app, I want to use dropzone.js
So, I installed dropzone by npm install --save-dev dropzone
And I include import this library in my polyfills.browser.ts
file
ANSWER
Answered 2017-Jul-02 at 09:30Open tsconfig.webpack.json
and add:
"skipLibCheck": true
QUESTION
Update
After @developer033 mentioned, I am running npm run server:prod and app is running in the prod mode. But I am not sure, how do I verify it is AOT optimized?
If I inspect main.bundle.js in to check if it has code for main.browser.aot.ts:
I see is of main.browser.ts and not of main.browser.aot.ts So I am not sure wheter I am using AOT build or not.
Original Post
Ok, I am able to compile my Angular2 project in AOT mode with Webpack and it creates two folder one is "dist" and other is "compiled", but I am not sure how to run the AOT project after compiling.
Build Command:
"build:aot:prod": "npm run clean:dist && npm run clean:aot && webpack --config config/webpack.prod.js --progress --profile --bail"
After compile, I run the command :
npm run webpack-dev-server
Now the app runs but I am not sure whether it is even utilizing AOT compiled code or not. I see no difference in both AOT and non AOT app in the browser.
tsconfig.webpack.json:
...ANSWER
Answered 2017-Jun-10 at 04:49As @developer033 mentioned, after running npm run build:aot
you should run npm run server:prod
to run using the files based on dist folder.
app is running after running npm run server:prod, but how do I verify if its AOT optimized
Angular application uses different methods for bootstrapping an application depending whether it's AOT or JIT compiled. For the JIT compiled application it uses:
QUESTION
My Angular application is currently at 4.1.3
with Typescript@2.0.3
. I read that with Typescript
greater than 2.0, @types
should be used.
Currently I have typings installed in the application. To migrate to using @types
, I have 3 questions:
1.Should I simply remove typings
from package.json
and tsconfig.json
? and install @types
packages?
- How do i decide what
@types
packages to install for my application? - Also should I delete
typings.json
file?
package.json:
...ANSWER
Answered 2017-May-24 at 23:25- Yes, you should remove typings from your configuration files, the
typings
directory and so do with 3. typings.json. However you should then configure@types
intsconfig.json
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install angular2-webpack-starter
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page