Skip to content

Commit

Permalink
Convert example to mjs syntax
Browse files Browse the repository at this point in the history
Fixes #88
  • Loading branch information
brijeshb42 committed May 30, 2024
1 parent d803cb9 commit 6d90d26
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/* eslint-env node */
// eslint-ignore-next-line import/no-unresolved
const { withPigment } = require('@pigment-css/nextjs-plugin');
const { experimental_extendTheme: extendTheme } = require('@mui/material/styles');
import { withPigment } from '@pigment-css/nextjs-plugin';
import { experimental_extendTheme as extendTheme } from '@mui/material';

/**
* @typedef {import('@pigment-css/nextjs-plugin').PigmentOptions} PigmentOptions
Expand Down Expand Up @@ -121,4 +119,4 @@ const nextConfig = {
pigment: pigmentOptions,
};

module.exports = withPigment(nextConfig);
export default withPigment(nextConfig);
1 change: 1 addition & 0 deletions apps/pigment-css-next-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "@app/next-app",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"dev": "next dev",
"build": "next build",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { withPigment, extendTheme } = require('@pigment-css/nextjs-plugin');
import { withPigment, extendTheme } from '@pigment-css/nextjs-plugin';

// To learn more about theming, visit https://github.com/mui/pigment-css/blob/master/README.md#theming
const theme = extendTheme({
Expand All @@ -22,7 +22,11 @@ const theme = extendTheme({
},
});

/** @type {import('next').NextConfig} */
const nextConfig = {};
/** @type {import('@pigment-css/nextjs-plugin').WithPigmentOptions} */
const nextConfig = {
pigment: {
theme,
},
};

module.exports = withPigment(nextConfig, { theme });
module.exports = withPigment(nextConfig);

0 comments on commit 6d90d26

Please sign in to comment.