Skip to content
Gunjan Datta edited this page Mar 3, 2019 · 6 revisions

Create Project

We will be using Node Package Manage to manage our libraries.

Create the project

Create the project folder, and navigate to it in your console. Below is the command to create the project. We will use "--y" to auto-select the default options.

npm init --y

Example

initialize project

Download Libraries

Open the project in VS Code. Press ctrl+` to display the terminal, which will be used to install the libraries using npm.

Required for Solution

We will be using the gd-sprest-bs library for this solution.

SharePoint REST Bootstrap Framework

The gd-sprest-bs library is used to interact with the SharePoint REST API and provide Bootstrap components designed for SharePoint.

npm i --save gd-sprest-bs

The 'i' is for "install" The '--save' will update the package.json file's "dependencies" property.

install dependencies

Required for Packaging Solution

We will be using webpack and babel to compile and bundle the solution.

Babel

Babel is used to compile the code into javascript. We will utilize the environment preset to ensure the solution will work in the current browser standards.

npm i --save-dev @babel/core @babel/preset-env

The '--save-dev' will update the package.json file's "devDependencies" property.

Webpack

Webpack is used to bundle the assets into a single file. We will use plugins to pass the files to babel through the webpack configuration file, created in the next step.

npm i --save-dev webpack webpack-cli ts-loader babel-loader
Custom Styling CSS/SASS (Optional)

If you want to use CSS/SASS to define custom styling, then you will need to include the webpack loaders for the library types.

CSS

npm i --save-dev style-loader css-loader

SASS

npm i --save-dev sass-loader node-sass
Dev Dependencies (All Libraries)
npm i --save-dev @babel/core @babel/preset-env webpack webpack-cli ts-loader babel-loader style-loader css-loader sass-loader node-sass

install dev dependencies