Skip to content

Commit

Permalink
feat: nextjs plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Markkos89 committed Sep 4, 2023
1 parent a10933d commit 86f590a
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 8 deletions.
2 changes: 1 addition & 1 deletion apps/website-ssr/public/sw.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"fix:eslint": "eslint --fix .",
"fix:prettier": "prettier --plugin-search-dir=. --write .",
"fix": "run-s fix:*",
"prepare": "husky install"
"prepare": "husky install",
"analyze": "cross-env ANALYZE=true pnpm build"
},
"lint-staged": {
"*": "prettier --ignore-unknown --write",
Expand All @@ -42,6 +43,7 @@
"@types/react": "18.2.16",
"@types/react-dom": "18.2.7",
"@types/testing-library__jest-dom": "5.14.9",
"cross-env": "^7.0.3",
"eslint": "8.45.0",
"eslint-config-custom": "workspace:*",
"husky": "8.0.3",
Expand Down
25 changes: 19 additions & 6 deletions packages/next-config/nextpwa.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
// const withBundleAnalyzer = require("@next/bundle-analyzer")({
const withPlugins = require("next-compose-plugins");
const withBundleAnalyzer = require("@next/bundle-analyzer");
// ({
// enabled: !!process.env.ANALYZE,
// });

const withPWA = require("next-pwa")({
dest: "public",
disable: process.env.NODE_ENV === "development",
});
const withPWA = require("next-pwa");
// ({
// dest: "public",
// disable: process.env.NODE_ENV === "development",
// });

module.exports = ({ basePath }) => {
/** @type {import('next').NextConfig} */
Expand All @@ -16,5 +19,15 @@ module.exports = ({ basePath }) => {
transpilePackages: ["ui", "utils"],
};

return withPWA(config);
return withPlugins(
[
[withBundleAnalyzer({ enabled: process.env.ANALYZE })],
withPWA({
dest: "public",
disable: process.env.NODE_ENV === "development",
}),
],
config,
);
// return withPWA(config);
};
1 change: 1 addition & 0 deletions packages/next-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"version": "0.0.0",
"devDependencies": {
"@next/bundle-analyzer": "13.4.12",
"next-compose-plugins": "^2.2.1",
"next-pwa": "^5.6.0"
}
}
18 changes: 18 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 86f590a

Please sign in to comment.