setting env with NODE_ENV

This commit is contained in:
James Gareth Smith 2018-07-09 09:59:57 +02:00
parent 1a6179e931
commit ebad436212
3 changed files with 8 additions and 4 deletions

3
.gitignore vendored
View File

@ -1,4 +1,5 @@
/out /out
.next .next
node_modules node_modules
.DS_Store .DS_Store
yarn.lock

View File

@ -9,4 +9,4 @@ ETHPrize single page React website
`npm run deploy` to deploy to `https://nona-creative.github.io/ETHPrize` `npm run deploy` to deploy to `https://nona-creative.github.io/ETHPrize`
`yarn lint` runs the eslinter `npm lint` runs the eslinter

View File

@ -1,7 +1,10 @@
const withSass = require('@zeit/next-sass') const withSass = require('@zeit/next-sass');
const dev = process && process.env && process.env.NODE_ENV === 'development';
module.exports = module.exports =
withSass({ withSass({
assetPrefix: isProduction ? '/ETHPrize' : '', assetPrefix: dev ? '' : '/ETHPrize',
exportPathMap: function(defaultPathMap) { exportPathMap: function(defaultPathMap) {
return { return {
'/': { page: '/' } '/': { page: '/' }