-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix svelte packages being required all the time (#327)
* update example * Fix svelte packages being required all the time
- Loading branch information
Showing
4 changed files
with
65 additions
and
6 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
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,48 @@ | ||
<script> | ||
import { onMount } from 'svelte'; | ||
// I am top level comment in this file. | ||
// I am second line of top level comment in this file. | ||
import React from 'react'; | ||
import thirdParty from 'third-party'; | ||
import something from '@server/something'; | ||
import component from '@ui/hello'; | ||
import fourLevelRelativePath from '../../../../fourLevelRelativePath'; | ||
import threeLevelRelativePath from '../../../threeLevelRelativePath'; | ||
import twoLevelRelativePath from '../../twoLevelRelativePath'; | ||
import oneLevelRelativePath from '../oneLevelRelativePath'; | ||
import sameLevelRelativePath from './sameLevelRelativePath'; | ||
import otherthing from '@core/otherthing'; | ||
let count = 0; | ||
function increment() { | ||
count += 1; | ||
} | ||
</script> | ||
|
||
<main> | ||
<h1>Hello Svelte!</h1> | ||
<p>The count is {count}</p> | ||
<button on:click={increment}>Increment</button> | ||
</main> | ||
|
||
<style> | ||
main { | ||
text-align: center; | ||
padding: 1em; | ||
max-width: 240px; | ||
margin: 0 auto; | ||
} | ||
h1 { | ||
color: #ff3e00; | ||
} | ||
button { | ||
font-size: 1.2em; | ||
} | ||
</style> |
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,8 @@ | ||
export function createSvelteParsers() { | ||
try { | ||
var { parsers } = require('prettier-plugin-svelte'); | ||
} catch { | ||
return {}; | ||
} | ||
return { parsers }; | ||
} |