.NET MVC, Webpack and Vue.js — Part 3 — NPM packages
- Part 1 — Tools;
- Part 2 — Project structure;
- Part 3 — NPM Packages;
- Part 4 — Webpack Configuration;
- Part 5 — Vue.js;
- Part 6 — Vuex;
Now, we’ll work with the npm. Open the project root directory (not the solution root directory) on Explorer, press shift and right click > open CMD/PowerShell here.
Execute:
npm init -y
This will initialize a node package and create a package.json file, that contains some descriptions of the project, scripts to run and dev/dependencies, that we use at development time and runtime:
In Visual Studio, click in Show All Files icon and include package.json to the project:
Open package.json. The name needs to be lower case string. Delete the “test” script.
Install bootstrap/jquery/popper.js, vue and vuex from npm:
npm install jquery popper.js bootstrap vue vuex
Now, install the dev dependencies:
npm install -D @babel/core @babel/preset-env copy-webpack-plugin css-loader file-loader mini-css-extract-plugin node-sass sass-loader uglifyjs-webpack-plugin webpack webpack-cli
These dev dependencies will help us to transpile ES6 code, build .scss, concat, minify and uglify our js code.
We already to go to the next part
See ya.