3

Basically I want to add Vuejs (newest) to already existing ASP .NET Core 2.0 MVC project and then return Views from endpoints like /test, where those Views are using Vue scripts from wwwroot/js

So far I tried:

dotnet new --install Microsoft.AspNetCore.SpaTemplates::*

dotnet new vue

But I'd really want to have an empty project, as minimal amount of "js-not-wrtten-by-me" in project.

Thanks in advance.

PS: If I want to create content dynamically, then using endpoints via Controller isn't proper way to do that?

1

2 Answers 2

4

I use the new Vue cli 3 to scaffold a project inside .NET core solution. You can, for instance, put it inside a ClientApp folder. You will see something like this also with .NET spa templates. Once created, change the output of the files to build files to the wwwroot folder. Once there, you reference those files in your .cshtml page and you're all done.

I was writing my own webpack configuration and set up before but the new Vue cli makes all this not really worth it anymore.

EDIT: For everyone building multi-page applications and not SPA's, you can also take a look at the following example.

GitHub: https://github.com/danijelh/aspnetcore-vue-typescript-template

Sign up to request clarification or add additional context in comments.

Comments

0

Use LibMan, download libraries similar to npm, but is written in C#.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.