wwayne
wwayne

Reputation: 145

What the meaning of browserify . -t [envify --NODE_ENV production] | uglifyjs -cm > js/bundle.min.js

I saw this in flux chat examplethe.

browserify . -t [envify --NODE_ENV production] | uglifyjs -cm > js/bundle.min.js

Why is browserify . -t [envify --NODE_ENV production] used here?

Upvotes: 0

Views: 1217

Answers (1)

marcel
marcel

Reputation: 3149

things after -t are transformers. They will be called before the bundeling process. They can be use to transform your code into pure javascript.

For example: reactify can transform JSX to plain javascript and babelify gives you the opporunity to use es6 features like arrow functions and convert them to plain javascript (es5) before starting the bundeling process.

Here you can show what Envify is for. Short: It can declare node evironment variables as plain strings.

Upvotes: 1

Related Questions