Giter VIP home page Giter VIP logo

Comments (17)

damienbod avatar damienbod commented on May 25, 2024

Hi @photostu
Have you done a production webpack build from the cmdline "> npm run buildProduction"

Greetings Damien

from angularwebpackvisualstudio.

robisim74 avatar robisim74 commented on May 25, 2024

main-aot-ts file is the entry point for AoT compilation.

.ngfactory files are created in aot folder by ngc compiler when you do: npm run buildProduction.

You can find the explanation in official documentation: https://angular.io/docs/ts/latest/cookbook/aot-compiler.html

from angularwebpackvisualstudio.

photostu avatar photostu commented on May 25, 2024

Apologies guys... still a greenhorn with this webpack stuff... Thank you for the timely response.

from angularwebpackvisualstudio.

photostu avatar photostu commented on May 25, 2024

So, potential noob question still... what is the best way to get the server portion of this running as well? tsc is not a happy camper when attempting to build in VS

from angularwebpackvisualstudio.

FabianGosebrink avatar FabianGosebrink commented on May 25, 2024

Well tsc is the typescript compiler. If you want to get the server side running you can type

dotnet run on project-json level though this is a asp.net core application.

But hitting "play" in vs should work as well.

BR

Fabian

from angularwebpackvisualstudio.

photostu avatar photostu commented on May 25, 2024

yeah, server side won't build cause tsc has a ton of errors...

from angularwebpackvisualstudio.

photostu avatar photostu commented on May 25, 2024

some you can ignore, these show up all the time, but something is causing tsc to fail, thus breaking the build

from angularwebpackvisualstudio.

FabianGosebrink avatar FabianGosebrink commented on May 25, 2024

did you try dotnet run ?

from angularwebpackvisualstudio.

photostu avatar photostu commented on May 25, 2024

yes, that works, but it runs on :5000 and webpack-dev-server will run on another port.. that's gonna be hard to get working together ;-)

from angularwebpackvisualstudio.

robisim74 avatar robisim74 commented on May 25, 2024

Ok, you're confusing a lot of things.

You should not use tsc in this project because the compilation is made by webpack. To use it, you must ensure that you have:

  • TypeScript for Visual Studio 2.0.3
  • TypeScript 2.0.3 installed globally

Webpack-dev-server is an in memory building. However @damienbod we have to change the port 8080 in package.json or remove it.

Greetings

from angularwebpackvisualstudio.

FabianGosebrink avatar FabianGosebrink commented on May 25, 2024

Just to be clear: I think @photostu is starting via Visual Studio, then Visual Studio is implicitly running the tsc and throws errors and thats why the backend from Visual Studio does not start. Did I get you right?

Having the front- and the backend on different domains should not be a problem. @damienbod we should activate CORS. --> EDIT: I just added CORS

BR

from angularwebpackvisualstudio.

FabianGosebrink avatar FabianGosebrink commented on May 25, 2024

With the commit

8482470

typescript gets not compiled anymore directly form Visual Studio. If you now start from VS it should work. If you type npm start it is starting the frontend (webpack-dev-server) AND the backend (dotnet run). Because we activated CORS having front- and backend on different domains/ports/servers etc. should not be a problem.

BR & HTH

from angularwebpackvisualstudio.

photostu avatar photostu commented on May 25, 2024

We're getting there... get the solution clean. Run npm run start... dist folder not created.. ok, so go back and do npm run buildProduction, stuff created proper now.. now go back and npm run start... lost dist folder.

Determining this workflow for debugging is certainly not easy, I appreciate the help today for sure.
what should the expected flow be?

from angularwebpackvisualstudio.

robisim74 avatar robisim74 commented on May 25, 2024

Hi @photostu,

after the commits of @FabianGosebrink, when you do: npm start from the command line, you start concurrently:

After the launch, you can browse on localhost:8080

cattura di schermata 8

If it still doesn't work, I think it's a configuration problem: please, let us know your:

  • Version of Windows
  • Version of Visual Studio
  • Version of TypeScript for Visual Studio
  • Version of .NET Core SDK
  • Version of node & npm

And please, for different questions, open different issues.

Thanks!

from angularwebpackvisualstudio.

photostu avatar photostu commented on May 25, 2024

Ok, I was still going to the 5000 port, switching over to 8080 works and produces the same output. Thanks for the assistance. I'll try not to bug you guys too much more ;-)

from angularwebpackvisualstudio.

FabianGosebrink avatar FabianGosebrink commented on May 25, 2024

It's the same output because on port 8080 the webpack dev server is running. Think of it as a live-reload-server "hosted" in the cache. There is no physically output. It works because the app communicates with the dotnet-core-app which is running on port 5000. There, on port 5000, the dotnet-core app is running serving from the wwwroot-folder. There we are building all the app-files in before starting the app. Thats why the content is the same.

You could also start a lite-server serving from wwwroot, having a watcher watching on the angular2app-folder, copying files to the wwwroot when changing. Would be quite the same.

Hopefully I did not make any confusion but clarified some things :)

BR

Fabian

from angularwebpackvisualstudio.

photostu avatar photostu commented on May 25, 2024

Thank you for the clarification. I appreciate the explanations for sure :-)

from angularwebpackvisualstudio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.