Skip to content

Commit 35f5efe

Browse files
authored
Merge pull request #407 from timolins/minify-inline-css
Minify inline css
2 parents 3251bf1 + 6dca025 commit 35f5efe

File tree

6 files changed

+121
-57
lines changed

6 files changed

+121
-57
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
"@types/jest": "^29.5.14",
8181
"@types/react": "^18.3.18",
8282
"@types/react-dom": "^18.3.5",
83+
"esbuild-minify-templates": "^0.13.1",
8384
"jest": "^29.7.0",
8485
"jest-environment-jsdom": "^29.7.0",
8586
"prettier": "^2.8.8",

pnpm-lock.yaml

Lines changed: 92 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/next.config.mjs

Lines changed: 23 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import rehypeSlug from 'rehype-slug';
22
import remarkGfm from 'remark-gfm';
33
import nextMdx from '@next/mdx';
4-
import withPlugins from 'next-compose-plugins';
54

65
const withMDX = nextMdx({
76
extension: /\.mdx?$/,
@@ -12,42 +11,28 @@ const withMDX = nextMdx({
1211
},
1312
});
1413

15-
const withSvgr = (nextConfig = {}, nextComposePlugins = {}) => {
16-
return Object.assign({}, nextConfig, {
17-
webpack(config, options) {
18-
config.module.rules.push({
19-
test: /.svg$/,
20-
use: ['@svgr/webpack'],
21-
});
22-
23-
if (typeof nextConfig.webpack === 'function') {
24-
return nextConfig.webpack(config, options);
25-
}
26-
27-
return config;
28-
},
29-
});
14+
/** @type {import('next').NextConfig} */
15+
const nextConfig = {
16+
pageExtensions: ['ts', 'tsx', 'md', 'mdx'],
17+
webpack(config) {
18+
config.module.rules.push({
19+
test: /\.svg$/,
20+
use: ['@svgr/webpack'],
21+
});
22+
return config;
23+
},
24+
async rewrites() {
25+
return [
26+
{
27+
source: '/bee.js',
28+
destination: 'https://cdn.splitbee.io/sb.js',
29+
},
30+
{
31+
source: '/_hive/:slug',
32+
destination: 'https://hive.splitbee.io/:slug',
33+
},
34+
];
35+
},
3036
};
3137

32-
export default withPlugins(
33-
[
34-
withMDX({
35-
pageExtensions: ['ts', 'tsx', 'md', 'mdx'],
36-
}),
37-
withSvgr,
38-
],
39-
{
40-
rewrites() {
41-
return [
42-
{
43-
source: '/bee.js',
44-
destination: 'https://cdn.splitbee.io/sb.js',
45-
},
46-
{
47-
source: '/_hive/:slug',
48-
destination: 'https://hive.splitbee.io/:slug',
49-
},
50-
];
51-
},
52-
}
53-
);
38+
export default withMDX(nextConfig);

site/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
"@types/react": "^18.3.18",
2929
"@types/react-dom": "^18.3.5",
3030
"autoprefixer": "^10.4.20",
31-
"next-compose-plugins": "^2.2.1",
3231
"remark-gfm": "^3.0.1",
3332
"tailwindcss": "^3.4.17",
3433
"typescript": "^4.9.5"

0 commit comments

Comments
 (0)