Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
const { ANALYZE } = process.env

module.exports = {
webpack: (config, { dev }) => {
if (!dev) {
// preact
console.log('> Using Preact instead of React')
config.resolve.alias = {
react: 'preact-compat/dist/preact-compat',
'react-dom': 'preact-compat/dist/preact-compat'
}
// Bundle Analyzer
if (ANALYZE) {
config.plugins.push(
new BundleAnalyzerPlugin({
analyzerMode: 'server',
analyzerPort: 8888,
openAnalyzer: true
})
)
}
}
return config
}
}
14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@
"express": "^4.15.3",
"lodash.debounce": "^4.0.8",
"lru-cache": "^4.0.2",
"next": "^2.4.3",
"next": "^2.4.7",
"preact": "^8.2.0",
"preact-compat": "^3.16.0",
"prop-types": "^15.5.10",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"react-ga": "^2.2.0"
"react-ga": "^2.2.0",
"react-masonry-component": "^5.0.5",
"webpack-bundle-analyzer": "^2.8.2"
},
"devDependencies": {
"babel-eslint": "^7.2.3",
"cross-env": "^5.0.1",
"husky": "^0.13.4",
"lint-staged": "^3.6.1",
"prettier": "^1.4.4",
Expand All @@ -27,7 +32,8 @@
"build": "next build && git rev-parse HEAD > .next/BUILD_ID",
"start": "NODE_ENV=production node server.js",
"lint": "prettier 'utils/**/*.js' 'static/js/**/*.js' 'components/**/*.js' 'pages/**/*.js' '*.js' --write --single-quote --no-semi && standard --fix",
"precommit": "lint-staged"
"precommit": "lint-staged",
"analyze": "cross-env ANALYZE=1 next build"
},
"lint-staged": {
"*.js": [
Expand All @@ -43,4 +49,4 @@
],
"parser": "babel-eslint"
}
}
}
Loading