@stylexjs/nextjs-plugin
v0.9.3
Published
Next.js plugin for StyleX
Downloads
11,447
Readme
@stylexjs/nextjs-plugin
Documentation Website
Installation
Install the package by using:
npm install --save-dev @stylexjs/nextjs-plugin
or with yarn:
yarn add --dev @stylexjs/nextjs-plugin
:warning:
@/
alias is unsupported at the moment.
Add the following to your .babelrc.js
module.exports = {
presets: ['next/babel'],
plugins: [
[
'@stylexjs/babel-plugin',
{
dev: process.env.NODE_ENV === 'development',
runtimeInjection: false,
genConditionalClasses: true,
unstable_moduleResolution: {
type: 'commonJS',
rootDir: __dirname,
},
},
],
],
};
Add the following to your next.config.js
const stylexPlugin = require('@stylexjs/nextjs-plugin');
module.exports = stylexPlugin({
rootDir: __dirname,
})({});