I’m currently trying to register components with plasmic using the code gen integration. Everything works fine, except that the import paths of my customer components generated by plasmic sync
are incorrect. The import paths should be relative to srcDir
but this is not the case. I think this might be a bug.
plasmic.json (look for srcDir
)
{
"platform": "nextjs",
"code": {
"lang": "ts",
"scheme": "blackbox",
"reactRuntime": "classic"
},
"style": {
"scheme": "css-modules",
"defaultStyleCssFilePath": "plasmic/plasmic__default_style.module.css"
},
"images": {
"scheme": "public-files",
"publicDir": "../../public",
"publicUrlPrefix": "/"
},
"tokens": {
"scheme": "theo",
"tokensFilePath": "plasmic-tokens.theo.json"
},
"srcDir": "src/components",
"defaultPlasmicDir": "./plasmic",
...
PlasmicHome.tsx (place where put the components in the Plasmic Designer):
...
import Header from '../../Header'; // plasmic-import: yJBWO7USHcqDo/component
import Section from '../../Section'; // plasmic-import: VZExbDo_QFX1A_/component
import SimpleMultistepForm from 'SimpleMultistepForm'; // plasmic-import: 8fyNjfo6Bq/codeComponent
import SimpleFormStep from 'SimpleFormStep'; // plasmic-import: 09Gsfu_Tis/codeComponent
import Button from '../../Button'; // plasmic-import: jFOh0bsuw0hzuU/component
import FeatureCard from '../../FeatureCard'; // plasmic-import: 0-lpEtyf34LW
...
The import paths are included absolute, rather than relative. They should be ../../SimpleMultistepForm
Directory structure