module.exports = {
compiler: {
// see https://styled-components.com/docs/tooling#babel-plugin for more info on the options.
styledComponents: {
// Enabled by default in development, disabled in production to reduce file size,
// setting this will override the default for all environments.
displayName?: boolean,
// Enabled by default.
ssr?: boolean,
// Enabled by default.
fileName?: boolean,
// Empty by default.
topLevelImportPaths?: string[],
// Defaults to ["index"].
meaninglessFileNames?: string[],
// Enabled by default.
cssProp?: boolean,
// Empty by default.
namespace?: string,
// Not supported yet.
minify?: boolean,
// Not supported yet.
transpileTemplateLiterals?: boolean,
// Not supported yet.
pure?: boolean,
},
},
}
This will render a warning:
⚠ Array must contain at least 1 element(s) at "compiler.styledComponents.topLevelImportPaths"
⚠ Array must contain at least 1 element(s) at "compiler.styledComponents.meaninglessFileNames"
Verify canary release
Link to code that reproduces this issue
https://github.com/ivoba/turborepo-styledcomponents-warning
What package manager are you using / does the bug impact?
npm, Yarn v2/v3/v4 (node_modules linker only)
What operating system are you using?
Mac
Which canary version will you have in your reproduction?
turbo@2.0.12-canary.1
Describe the Bug
Using the recommended styledComponents config from here: https://nextjs.org/docs/architecture/nextjs-compiler#styled-components
This will render a warning:
Json schema definition: https://github.com/vercel/turbo/blob/49c67593edb6c2c1389d38ab61cbb3ece3810c92/crates/turbopack-ecmascript-plugins/src/transform/styled_components.rs#L34C13-L34C35
This should probably allow empty Arrays, same goes for
meaninglessFileNames
Expected Behavior
There should be no confusing warnings for the recommended styledcomponents configuration.
To Reproduce
Additional context
No response