Skip to content

Commit

Permalink
build with cross-env
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeed committed Jan 9, 2017
1 parent a049f53 commit ff43142
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"url": "https://lukeed.com"
},
"scripts": {
"build": "NODE_ENV=production webpack --config config/webpack",
"build": "cross-env NODE_ENV=production webpack --config config/webpack",

This comment has been minimized.

Copy link
@kentcdodds

kentcdodds Feb 8, 2017

cross-env author here 👋
Have you thought about the cool new --env flag for webpack? If your config file exports a function, it'll accept an env object so you don't even need to use environment variables. learn more

Also, you may be interested in webpack-config-utils 👍

This comment has been minimized.

Copy link
@lukeed

lukeed Feb 8, 2017

Author Owner

@kentcdodds I know who you are! 😆 Wasn't aware of the update; thanks! It basically tuns my build command into:

"build": "webpack --env.production --config config/webpack"

Right? Will check out your utils too 😄

This comment has been minimized.

Copy link
@kentcdodds

kentcdodds Feb 8, 2017

Yep! That's it! And then you don't need cross-env! (breaks my heart 💔 only a little bit, but not really ❤️).

This comment has been minimized.

Copy link
@lukeed

lukeed Feb 8, 2017

Author Owner

Lol, well luckily you can't force me to not use cross-env in my other, non-webpack modules 😁

This comment has been minimized.

Copy link
@lukeed

lukeed Feb 9, 2017

Author Owner

It is done e065b69 😿

"start": "serve dist -s",
"watch": "webpack-dashboard -- webpack-dev-server --config config/webpack"
},
Expand All @@ -29,6 +29,7 @@
"babel-preset-stage-2": "^6.18.0",
"clean-webpack-plugin": "^0.1.14",
"copy-webpack-plugin": "^4.0.1",
"cross-env": "^3.1.4",
"css-loader": "^0.26.1",
"extract-text-webpack-plugin": "beta",
"html-webpack-plugin": "^2.25.0",
Expand Down
8 changes: 7 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1457,7 +1457,13 @@ create-hmac@^1.1.0, create-hmac@^1.1.2:
create-hash "^1.1.0"
inherits "^2.0.1"

cross-spawn@^3.0.0:
cross-env@^3.1.4:
version "3.1.4"
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-3.1.4.tgz#56e8bca96f17908a6eb1bc2012ca126f92842130"
dependencies:
cross-spawn "^3.0.1"

cross-spawn@^3.0.0, cross-spawn@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-3.0.1.tgz#1256037ecb9f0c5f79e3d6ef135e30770184b982"
dependencies:
Expand Down

0 comments on commit ff43142

Please sign in to comment.