Is your feature request related to a problem? Please describe.
Currently, @slicemachine/adapter-next generates a prismicio.js file at the root of the project. If a project is set up with Next.js' recommended @/* alias (see the --import-alias option in create-next-app), the file can be imported anywhere in the project using @/prismicio.
However, if a project also uses the recommended src directory, the @/prismicio import no longer works. The alias is mapped to ./src, which does not contain the generated prismicio.js file.
Describe the solution you'd like
Generate the prismicio.js file at src/prismicio.js if the project contains a src directory.
@slicemachine/adapter-next already does something similar when generating the slice-simulator.js file. See this excerpt.
Describe alternatives you've considered
Import prismicio.js using relative paths, which is more mental effort than @/prismicio.
Is your feature request related to a problem? Please describe.
Currently,
@slicemachine/adapter-next
generates aprismicio.js
file at the root of the project. If a project is set up with Next.js' recommended@/*
alias (see the--import-alias
option increate-next-app
), the file can be imported anywhere in the project using@/prismicio
.However, if a project also uses the recommended
src
directory, the@/prismicio
import no longer works. The alias is mapped to./src
, which does not contain the generatedprismicio.js
file.Describe the solution you'd like
Generate the
prismicio.js
file atsrc/prismicio.js
if the project contains asrc
directory.@slicemachine/adapter-next
already does something similar when generating theslice-simulator.js
file. See this excerpt.Describe alternatives you've considered
prismicio.js
using relative paths, which is more mental effort than@/prismicio
.Additional context
None