npm “global” packages

If you manage multiple themes with similar npm dependencies you should install npm packages globally and link them in your theme directories. First of all this saves a lot of disk space. But it also disburdens the upgrade process of development frameworks and toolkits that are used across projects.

1. Install packages globally by adding the ā€œ-gā€ flag:
$ npm install -g package_1 package_2 package_3 package_4 etc.

2. Link the packages in your local theme directory/directories:

Bootstrap-Theme
$ npm link bootstrap @popperjs/core browser-sync gulp gulp-sass gulp-sourcemaps gulp-postcss postcss sass autoprefixer cssnano webpack webpack-stream

Material-Theme
$ npm link material-components-web @babel/core @babel/preset-env babel-loader autoprefixer css-loader sass sass-loader extract-loader file-loader postcss-loader path webpack webpack-cli webpack-dev-server

FSE-Theme
$ npm link autoprefixer css-loader sass sass-loader extract-loader file-loader postcss-loader path webpack webpack-cli webpack-dev-server

Happy Coding!

#development, #npm, #tip