Skip to content

Instantly share code, notes, and snippets.

@jeffryang24
Forked from elken/next.config.js
Created October 30, 2019 17:16
Show Gist options
  • Save jeffryang24/d501c08a30fcf9f45dad17f77261d581 to your computer and use it in GitHub Desktop.
Save jeffryang24/d501c08a30fcf9f45dad17f77261d581 to your computer and use it in GitHub Desktop.
const withTypescript = require('@zeit/next-typescript')
const withCss = require('@zeit/next-css')
const withSass = require('@zeit/next-sass');
const withImages = require('next-images');
const withOffline = require('next-offline');
const withManifest = require('next-manifest')
const pipe = (...ops) => ops.reduce((a, b) => (arg) => b(a(arg)));
const isProd = process.env.NODE_ENV === 'production';
const manifest = {
"short_name": "next-offline-test-app",
"name": "next-offline-test-app",
"description": "Reproduce a bug to help fix it",
"dir": "ltr",
"lang": "en",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": "/",
"display": "standalone",
"theme_color": "#ffffff",
"background_color": "#ffffff"
}
const settings = {
webpack: function (config) {
return config;
},
env: {
pagePrefix: isProd ? '/dash' : '',
apiUrl: '<redacted>'
},
assetPrefix: isProd ? '<redacted>' : '',
manifest
}
const wrapper = pipe(withManifest, withOffline, withCss, withTypescript, withSass, withImages);
module.exports = wrapper(settings);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment