teleport-code-generators
teleport-code-generators copied to clipboard
Page or component style page-name should be different from global-styles
Change the global-stylesheet name to global-style
across all flavours. In certain flavours we are having the name of pages and global styles as same. This is creating a clash for the imports. Here is a example to reproduce it
https://codesandbox.io/s/d039b?file=/src/routes/home/index.js
Since we save the dependencies from plugins using a Record<string, UIDLDependency>
. When the file names are same and still paths are different, while saving with the DS we do using file name alone and not path. So the dependencies are joining even paths are different.
Expected
import projectStyles from '../../style.css'
import styles from './style.css'
Current behaviour
import projectStyles, { styles } from './style.css'
This is solved in teleport-project-generator-preact
. That can be taken as reference to do the same for the rest of the frameworks.
https://github.com/teleporthq/teleport-code-generators/blob/development/packages/teleport-project-generator-preact/src/index.ts#L56
https://github.com/teleporthq/teleport-code-generators/blob/development/packages/teleport-project-generator-preact/src/index.ts#L24