Skip to content

Instantly share code, notes, and snippets.

@jermsam
Last active June 10, 2020 21:30
Show Gist options
  • Save jermsam/073c717f98d8a32c063daba96b9a3294 to your computer and use it in GitHub Desktop.
Save jermsam/073c717f98d8a32c063daba96b9a3294 to your computer and use it in GitHub Desktop.
// incase you want your custom nextjs modules to be imported as absolute paths
require('dotenv').config()
const path = require('path');
module.exports ={
env:{
MY_STEP:process.env.MY_STEP
},
serverRuntimeConfig: {
// Will only be available on the server side
MY_SECRET: process.env.MY_SECRET
},
publicRuntimeConfig: {
// Will be available on both server and client
API_ENDPOINT: '/myapi/version/1',
},
// enable absolute path (eg: container/Home instead of ../container/Home)
webpack(config) {
config.resolve.modules.push(path.resolve('./'))
return config
}
}
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"baseUrl": ".",
"paths": {
"*": [
"*"
]
}
},
"exclude": [
"node_modules"
],
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment