mirror of https://github.com/sgoudham/carbon.git
parent
b000e7093c
commit
a507b07dc3
@ -1,31 +1,24 @@
|
|||||||
const bundleAnalyzer = require('@next/bundle-analyzer')
|
const bundleAnalyzer = require('@next/bundle-analyzer')
|
||||||
const withOffline = require('next-offline')
|
const withOffline = require('next-offline')
|
||||||
|
|
||||||
const withBundleAnalyzer = bundleAnalyzer({ enabled: true })
|
const withBundleAnalyzer = bundleAnalyzer({ enabled: process.env.ANALYZE === 'true' })
|
||||||
|
|
||||||
const config = withOffline({
|
module.exports = withBundleAnalyzer(
|
||||||
target: 'serverless',
|
withOffline({
|
||||||
dontAutoRegisterSw: true,
|
target: 'serverless',
|
||||||
// https://github.com/hanford/next-offline/blob/master/packages/now2-example/next.config.js
|
dontAutoRegisterSw: true,
|
||||||
workboxOpts: {
|
// https://github.com/hanford/next-offline/blob/master/packages/now2-example/next.config.js
|
||||||
swDest: 'static/service-worker.js',
|
workboxOpts: {
|
||||||
},
|
swDest: 'static/service-worker.js',
|
||||||
env: {
|
},
|
||||||
FIREBASE_PROJECT_ID: process.env.FIREBASE_PROJECT_ID,
|
webpack: (config, options) => {
|
||||||
FIREBASE_MESSAGING_SENDER_ID: process.env.FIREBASE_MESSAGING_SENDER_ID,
|
config.module.rules.push({
|
||||||
FIREBASE_FE_APP_ID: process.env.FIREBASE_FE_APP_ID,
|
test: /\.js$/,
|
||||||
FIREBASE_API_KEY: process.env.FIREBASE_API_KEY,
|
include: /node_modules\/graphql-language-service-parser/,
|
||||||
STRIPE_PUBLIC_KEY: process.env.STRIPE_PUBLIC_KEY,
|
use: [options.defaultLoaders.babel],
|
||||||
},
|
})
|
||||||
webpack: (config, options) => {
|
|
||||||
config.module.rules.push({
|
|
||||||
test: /\.js$/,
|
|
||||||
include: /node_modules\/graphql-language-service-parser/,
|
|
||||||
use: [options.defaultLoaders.babel],
|
|
||||||
})
|
|
||||||
|
|
||||||
return config
|
return config
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
)
|
||||||
module.exports = process.env.ANALYZE === 'true' ? withBundleAnalyzer(config) : config
|
|
||||||
|
Loading…
Reference in New Issue