Skip to content

Instantly share code, notes, and snippets.

Adding environment variables

Setting a global variable

In webpack.*.js add webpack.DefinePlugin call with the process.env definition

plugins: [
	new webpack.HotModuleReplacementPlugin(),
	new webpack.NamedModulesPlugin(),
	new webpack.DefinePlugin({

Adding Prettier into a project

Install libraries

npm install --save-dev --save-exact prettier
npm install pretty-quick husky --save-dev

prettier

Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.