-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:sveltejs/kit
- Loading branch information
Showing
13 changed files
with
180 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export { | ||
EndpointManifest, | ||
PageManifest, | ||
PageComponentManifest, | ||
SetupModule, | ||
SSRComponentModule | ||
} from './src/types'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { bold, green } from 'kleur/colors'; | ||
import { add_svelte_prepocess_to_config, update_component, update_package_json } from './utils'; | ||
|
||
export default async function add_css(cwd: string, which: 'css' | 'less' | 'scss'): Promise<void> { | ||
if (which === 'css') { | ||
console.log(`You can add support for CSS preprocessors like SCSS/Less/PostCSS later.`); | ||
} else if (which === 'less') { | ||
update_package_json(cwd, { | ||
less: '^3.0.0', | ||
'svelte-preprocess': '^4.0.0' | ||
}); | ||
update_component(cwd, 'src/components/Counter.svelte', [['<style>', '<style lang="less">']]); | ||
update_component(cwd, 'src/routes/index.svelte', [['<style>', '<style lang="less">']]); | ||
add_svelte_prepocess_to_config(cwd); | ||
console.log( | ||
bold( | ||
green( | ||
`✔ Added Less support. ` + | ||
`To use it inside Svelte components, add lang="less" to the attributes of a style tag.` | ||
) | ||
) | ||
); | ||
} else if (which === 'scss') { | ||
update_package_json(cwd, { | ||
sass: '^1.0.0', | ||
'svelte-preprocess': '^4.0.0' | ||
}); | ||
update_component(cwd, 'src/components/Counter.svelte', [['<style>', '<style lang="scss">']]); | ||
update_component(cwd, 'src/routes/index.svelte', [['<style>', '<style lang="scss">']]); | ||
add_svelte_prepocess_to_config(cwd); | ||
console.log( | ||
bold( | ||
green( | ||
`✔ Added SCSS support. ` + | ||
`To use it inside Svelte components, add lang="scss" to the attributes of a style tag.` | ||
) | ||
) | ||
); | ||
} else { | ||
console.error(`Unknown CSS option "${which}"`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.