Skip to content

Commit

Permalink
feat: add preact via next-plugin-preact
Browse files Browse the repository at this point in the history
try to get rid of explicit 'scheduler' dependency, see
vercel/next.js#31240
same with babel stuff
  • Loading branch information
einSelbst committed Jan 28, 2022
1 parent 8d7d397 commit 150a4ef
Show file tree
Hide file tree
Showing 5 changed files with 246 additions and 85 deletions.
43 changes: 24 additions & 19 deletions next.config.js
Expand Up @@ -7,6 +7,7 @@
*/
const { withSentryConfig } = require('@sentry/nextjs')
const { withPlugins, optional } = require('next-compose-plugins')
const withPreact = require('next-plugin-preact')
const withPWA = require('next-pwa')
const { PHASE_DEVELOPMENT_SERVER } = require('next/constants')

Expand Down Expand Up @@ -127,6 +128,7 @@ const plugins = () =>
},
['!', PHASE_DEVELOPMENT_SERVER],
],
withPreact,
[
withPWA,
{
Expand All @@ -151,26 +153,29 @@ const plugins = () =>
],
]
: [
withPWA,
{
pwa: {
/* additionalManifestEntries: [ */
/* '/', */
/* '/map', */
/* '/collection', */
/* '/offline', */
/* ].map(url => ({ */
/* revision: buildId, */
/* url, */
/* })), */
dest: 'public',
disable: process.env.NODE_ENV === 'development',
/* dontCacheBustURLsMatching: /^\/_next\/static\/.* /i, */
/* register: false, */
/* skipWaiting: false, */
/* swSrc: 'utils/serviceWorker.ts', */
withPreact,
[
withPWA,
{
pwa: {
/* additionalManifestEntries: [ */
/* '/', */
/* '/map', */
/* '/collection', */
/* '/offline', */
/* ].map(url => ({ */
/* revision: buildId, */
/* url, */
/* })), */
dest: 'public',
disable: process.env.NODE_ENV === 'development',
/* dontCacheBustURLsMatching: /^\/_next\/static\/.* /i, */
/* register: false, */
/* skipWaiting: false, */
/* swSrc: 'utils/serviceWorker.ts', */
},
},
},
],
]

const nextPluginConfiguration = withPlugins(plugins(), nextConfiguration)
Expand Down
14 changes: 11 additions & 3 deletions package.json
Expand Up @@ -114,6 +114,7 @@
},
"dependencies": {
"@babel/core": "7.16.12",
"@prefresh/babel-plugin": "0.4.1",
"@sentry/nextjs": "6.17.3",
"@types/node": "16.11.21",
"@types/react": "17.0.38",
Expand All @@ -124,13 +125,19 @@
"is-ci": "3.0.1",
"next": "12.0.9",
"next-compose-plugins": "2.2.1",
"next-plugin-preact": "3.0.6",
"next-pwa": "5.4.4",
"next-seo": "4.29.0",
"next-sitemap": "1.9.12",
"next-themes": "0.0.15",
"react": "17.0.2",
"react-dom": "17.0.2",
"postcss": "8.4.5",
"preact": "10.6.4",
"preact-render-to-string": "5.1.19",
"react": "npm:@preact/compat@17.0.2",
"react-dom": "npm:@preact/compat@17.0.2",
"react-ssr-prepass": "npm:preact-ssr-prepass@1.2.0",
"sass": "1.49.0",
"scheduler": "0.20.2",
"tailwindcss": "3.0.18",
"typed-query-selector": "2.6.1",
"typescript": "4.5.5",
Expand All @@ -152,14 +159,15 @@
"@tailwindcss/line-clamp": "0.3.1",
"@tailwindcss/typography": "0.5.1",
"@testing-library/jest-dom": "5.16.1",
"@testing-library/react": "12.1.2",
"@testing-library/preact": "2.0.1",
"@types/babel__core": "7.1.18",
"@types/core-js": "2.5.5",
"@types/eslint": "8.4.1",
"@types/is-ci": "3.0.0",
"@types/jest": "27.4.0",
"@types/prettier": "2.4.3",
"@types/sass": "1.43.1",
"@types/scheduler": "0.16.2",
"@types/source-map-support": "0.5.4",
"@types/standard-version": "7.0.1",
"@types/stylelint": "13.13.3",
Expand Down

0 comments on commit 150a4ef

Please sign in to comment.