|
|
@ -1,22 +1,16 @@
|
|
|
|
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(
|
|
|
|
|
|
|
|
withOffline({
|
|
|
|
target: 'serverless',
|
|
|
|
target: 'serverless',
|
|
|
|
dontAutoRegisterSw: true,
|
|
|
|
dontAutoRegisterSw: true,
|
|
|
|
// https://github.com/hanford/next-offline/blob/master/packages/now2-example/next.config.js
|
|
|
|
// https://github.com/hanford/next-offline/blob/master/packages/now2-example/next.config.js
|
|
|
|
workboxOpts: {
|
|
|
|
workboxOpts: {
|
|
|
|
swDest: 'static/service-worker.js',
|
|
|
|
swDest: 'static/service-worker.js',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
env: {
|
|
|
|
|
|
|
|
FIREBASE_PROJECT_ID: process.env.FIREBASE_PROJECT_ID,
|
|
|
|
|
|
|
|
FIREBASE_MESSAGING_SENDER_ID: process.env.FIREBASE_MESSAGING_SENDER_ID,
|
|
|
|
|
|
|
|
FIREBASE_FE_APP_ID: process.env.FIREBASE_FE_APP_ID,
|
|
|
|
|
|
|
|
FIREBASE_API_KEY: process.env.FIREBASE_API_KEY,
|
|
|
|
|
|
|
|
STRIPE_PUBLIC_KEY: process.env.STRIPE_PUBLIC_KEY,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
webpack: (config, options) => {
|
|
|
|
webpack: (config, options) => {
|
|
|
|
config.module.rules.push({
|
|
|
|
config.module.rules.push({
|
|
|
|
test: /\.js$/,
|
|
|
|
test: /\.js$/,
|
|
|
@ -27,5 +21,4 @@ const config = withOffline({
|
|
|
|
return config
|
|
|
|
return config
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
)
|
|
|
|
module.exports = process.env.ANALYZE === 'true' ? withBundleAnalyzer(config) : config
|
|
|
|
|
|
|
|