Replies: 4 comments 1 reply
-
postcss.config.js const fs = require('fs');
const path = require('path');
const projectRoot = __dirname;
const monorepoRoot = path.join(projectRoot, '../../');
function getPackageIncludePaths(packageName, nodeModulePaths) {
let packagePath = null;
for (const nodeModulePath of nodeModulePaths) {
const packageJsonPath = path.resolve(nodeModulePath, packageName, 'package.json');
if (fs.existsSync(packageJsonPath)) {
packagePath = path.dirname(packageJsonPath);
break;
}
}
if (!packagePath) {
throw new Error(`Could not find package ${packageName}`);
}
return [path.join(packagePath, '**/*.{js,mjs}'), '!' + path.join(packagePath, 'node_modules/**/*.{js,mjs}')];
}
const openPropsIncludePaths = getPackageIncludePaths('@stylexjs/open-props', [
path.join(projectRoot, 'node_modules'),
path.join(monorepoRoot, 'node_modules'),
]);
// The existing @stylexjs/nextjs-plugin will be deprecated in the next release.
// https://stylexjs.com/blog/v0.10.0/#easier-adoption-with-the-all-new-postcss-plugin
module.exports = {
plugins: {
'@stylexjs/postcss-plugin': {
include: ['app/**/*.{js,jsx,ts,tsx}', 'src/**/*.{js,jsx,ts,tsx}', ...openPropsIncludePaths],
useCSSLayers: false,
},
autoprefixer: {},
},
}; .babelrc.js const path = require('path');
module.exports = {
presets: ['next/babel'],
plugins: [
[
'@stylexjs/babel-plugin',
// See all options in the babel plugin configuration docs:
// https://stylexjs.com/docs/api/configuration/babel-plugin/
{
dev: process.env.NODE_ENV === 'development',
genConditionalClasses: true,
treeshakeCompensation: true,
aliases: {
'@/*': [path.join(__dirname, './src/*')],
},
unstable_moduleResolution: {
type: 'commonJS',
rootDir: path.join(__dirname, '../..'),
},
},
],
],
}; |
Beta Was this translation helpful? Give feedback.
0 replies
-
operate system? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Please post this as an issue, not a discussion. Thanks |
Beta Was this translation helpful? Give feedback.
0 replies
-
This issue is fixed in #863. Will release a patch release with the fix later today. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi !) help plz)
Doesn't want to pass variables var(--1u5tued) in @stylexjs/postcss-plugin: 0.10.0.
"next": "14.2.21",
initial-value: "*"; - It should be 8.533rem. This code works in "@stylexjs/postcss-plugin": "0.10.0-beta.2".
package.json:
Beta Was this translation helpful? Give feedback.
All reactions