Skip to content
Minimal files to get you up and running with Vue components in ASP.NET MVC (webpack 4)
Branch: master
Clone or download
Latest commit 4a8c052 Jun 19, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Views/Home Update JS reference Feb 8, 2019
dist/js/components Add new dist files Feb 8, 2019
js/components Added new component loader file Feb 8, 2019
webpack Add resolve setting Feb 8, 2019
README.md Update README.md Jun 19, 2019
package.json Add files via upload Feb 7, 2019

README.md

mvc-vue-webpack4

By using these files, you can integrate Vue components in your ASP.NET MVC 5 project. Compiling your .vue files into usable .js files, just do 'npm run build:components' and you're good to go.

As the runtime for Vue shouldn't be included into the component.js files, a setting (optimization) was added to put the runtime in a separate vendors.js file. That file can be added in your layout page so it can be cached by the client's browser. In this example, it makes a difference of 104KB's that only needs to be downloaded once, whilst the component.js file (in the resulting dist folders) are only about 5KB per piece. Other imported npm libraries will also be included in that file...

Mind: you don't need to include the dist files in your project as those will be generated automatically by executing the npm command but I included them for completeness.

You can’t perform that action at this time.