Skip to content

Commit

Permalink
Add bundle analyzer to the complex example (#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
aralroca authored Dec 5, 2020
1 parent 07cf3b5 commit c6a8220
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion examples/complex/next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
const nextTranslate = require('next-translate')
const withMDX = require('@next/mdx')()
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})

console.log('Webpack version', require('webpack').version)

module.exports = nextTranslate(withMDX())
module.exports = nextTranslate(withBundleAnalyzer(withMDX()))
4 changes: 3 additions & 1 deletion examples/complex/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"license": "MIT",
"scripts": {
"dev": "next dev",
"build": "next build"
"build": "next build",
"analyze": "ANALYZE=true yarn build"
},
"dependencies": {
"@mdx-js/loader": "1.6.21",
Expand All @@ -16,6 +17,7 @@
"react-dom": "link:../../node_modules/react-dom"
},
"devDependencies": {
"@next/bundle-analyzer": "10.0.3",
"@types/node": "14.14.10",
"@types/react": "17.0.0",
"typescript": "4.1.2"
Expand Down

0 comments on commit c6a8220

Please sign in to comment.