Issue 1:
I am deploying in an environment with multiple servers behind a load balancer. We current build on one server then move those files everywhere. How do I deal with instances where there are environmental specific variables in the package that will be deployed?

[ x] I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

I would envision a process where I can build the application on a build server and deploy that built application to all servers in my environment and between environments where the environment specific information like the api url to use could be parameter without the need to run yarn build on each environment at deploy time.

Current Behavior

Today in the environment I deploy in, I have multiple environments. There is development, qa, staging, and production. Each environment have different variables like the URL of the server it's connecting to, which api it should use, or various keys to use for analytics. Today when we deploy, we run yarn install and build on each server that it's being deployed to except when deploying behind a load balancer. We build on the first server then SCP it over to the other servers. This keeps the build number in check and allows me to update config files with the appropriate values prior to building. If i were to build the file, then update the config, the updated configs would not reflected in the built package until I build again.

I am curious if I did this how would i deal with the variables that are different between environments? Does a hard coded build number care of that even though I have modified the config.js file after having built it on a build server and overridden that build file?

Context

My deploy process is messy and not very sustainable.

Your Environment

Tech
Version

next

node

OS

browser

etc

Issue 2:
[X ] I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Should be able to upgrade next 6 and still use styled-jsx with sass

Current Behavior

Working with next 5.1.0 upgrading to next 6 breaks importing a scss file to be used in styled-jsx

example

import style from './componentName.scss';

in component: <styled jsx>{style}</style>

On next 6 I get 'style is undefined'

package.json

"extract-text-webpack-plugin": "^3.0.2",

"extracted-loader": "^1.0.3",

"node-sass": "^4.7.2",

"postcss": "^6.0.16",

"postcss-cssnext": "^3.0.2",

"postcss-loader": "^2.0.10",

"sass-loader": "^6.0.6",

"styled-jsx-css-loader": "^0.3.0"

"styled-jsx-plugin-sass": "^0.2.2",

"autoprefixer": "^8.2.0",

babelrc

"presets": [
[
"next/babel",
{
"preset-env": { "modules": "commonjs" }
}
]
],
"plugins": [
[
"styled-jsx/babel",
{ "plugins": [
["styled-jsx-plugin-sass", {
"sassOptions": {
"includePaths": ["./styles"],
"precision": 2
}
}
]
]
}
]
]
}
```

next.config.js
```const ExtractTextPlugin = require('extract-text-webpack-plugin');

const dev = process.env.NODE_ENV !== 'production';
const path = require('path');
const getRoutes = require('./routes');

module.exports = {
exportPathMap: getRoutes,
webpack: (config) => {
config.module.rules.push({
test: /\.scss$/,
use: [
{
loader: 'emit-file-loader',
options: {
name: 'dist/[path][name].[ext]',
},
},
'babel-loader',
'styled-jsx-css-loader',
'postcss-loader',
],
});
return config;
},
};```
## Steps to Reproduce (for bugs)
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
1.
2.
3.
4.

## Context
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->

## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
| Tech | Version |
|---------|---------|
| next | 6 |
| node | 8.10.0 |
| OS | mac and windows |
| browser | |
| etc | |