This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { IncomingMessage } from 'http'; | |
import { TLSSocket } from 'tls'; | |
import { URL } from 'url'; | |
export function parseRequestUrl(req: IncomingMessage) { | |
let protocol = 'http'; | |
if ((req.socket as TLSSocket).encrypted) { | |
protocol = 'https'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = (nextConfig) => { | |
return Object.assign({}, nextConfig, { | |
webpack(webpackConfig, nextContext) { | |
// NOTE: use whatever environment variable you'd like here to determine | |
// what environment should have minimization disabled. | |
if (process.env.NODE_ENV === 'development') { | |
webpackConfig.optimization.minimize = false; | |
webpackConfig.optimization.minimizer = []; | |
} |
OlderNewer