slice-machine
slice-machine copied to clipboard
fix: allow for slashes in libPath
I didn't like having linted JS/TS outside of my src
folder. Therefor I'm using the following config inside of sm.json
:
{
"apiEndpoint": "https://***.cdn.prismic.io/api/v2",
"libraries": [
"@/src/slices"
],
"_latest": "0.0.45",
}
This made the import path incorrect inside of sm-resolver.js
e.g.:
import { Fragment } from 'react'
import * as Src/Slices from './src/slices'
const __allSlices = { ...Src/Slices, }
...
This MR changes the above to:
import { Fragment } from 'react'
import * as SrcSlices from './src/slices'
const __allSlices = { ...SrcSlices, }
...
Types of changes
- [x] Bug fix (a non-breaking change which fixes an issue)
- [ ] New feature (a non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Description
Not sure if this is breaking anywhere else, otherwise, enough should be mentioned. Perhaps it's an idea to fix this in the pascalize
function.
Edit: 2 commits, pick your poison :smile:
Hey again @Bram-Zijp, thank you so much for taking the time to open a PR! We'll have a look at it soon~
cc @arnaudlewis, @hypervillain