-
Notifications
You must be signed in to change notification settings - Fork 377
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the issue
In my next.js app I configure stylex.js using postcss
babel.config.js
const path = require("path");
module.exports = {
presets: ['next/babel'],
plugins: [
[
'@stylexjs/babel-plugin',
{
dev: process.env.NODE_ENV === 'development',
stylexSheetName: '<>',
runtimeInjection: false,
genConditionalClasses: true,
treeshakeCompensation: true,
aliases: {
"@/stylex/*": [path.join(__dirname, "src", "stylex", "*")]
},
unstable_moduleResolution: {
type: 'commonJS',
rootDir: __dirname,
},
},
],
],
};
postcss.config.js
const babelConfig = require('./babel.config.js');
module.exports = {
plugins: {
'@stylexjs/postcss-plugin': {
include: [
'./**/*.{js,jsx,ts,tsx}',
// any other files that should be included
// this should include NPM dependencies that use StyleX
],
useCSSLayers: false,
babelConfig
},
},
};
and I import colors from src/vars.stylex.ts like this
import { colors } from '@/stylex/vars.stylex';
It worked fine on macOs and linux, but got build error on windows
SyntaxError: Could not resolve the path to the imported file. Please ensure that the theme file has a .stylex.js or .stylex.ts file extension and follows the rules for defining variariables:
Expected behavior
It should build successfully on windows,
Steps to reproduce
run yarn build on terminal on windows
Test case
No response
Additional comments
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working