August 2017
Beginner
374 pages
10h 41m
English
Firstly, we will inject the NODE_ENV environment variable into our project, so that we know if we are in production or development mode:
const webpack = require('webpack')
// ...plugins: [
new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development') })],// ...
Now, we can use process.env.NODE_ENV anywhere in the project. The value ...
Read now
Unlock full access