Skip to content

Commit

Permalink
create-svelte: Actually fix component => lib transition (#529)
Browse files Browse the repository at this point in the history
  • Loading branch information
GrygrFlzr authored Mar 15, 2021
1 parent 0649eeb commit bb01514
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/rotten-singers-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-svelte': patch
---

Actually fix $component => $lib transition
4 changes: 2 additions & 2 deletions packages/create-svelte/cli/modifications/add_css.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default async function add_css(cwd, which) {
less: '^3.0.0',
'svelte-preprocess': '^4.0.0'
});
update_component(cwd, 'src/components/Counter.svelte', [['<style>', '<style lang="less">']]);
update_component(cwd, 'src/lib/Counter.svelte', [['<style>', '<style lang="less">']]);
update_component(cwd, 'src/routes/index.svelte', [['<style>', '<style lang="less">']]);
add_svelte_preprocess_to_config(cwd);
console.log(
Expand All @@ -25,7 +25,7 @@ export default async function add_css(cwd, which) {
sass: '^1.0.0',
'svelte-preprocess': '^4.0.0'
});
update_component(cwd, 'src/components/Counter.svelte', [['<style>', '<style lang="scss">']]);
update_component(cwd, 'src/lib/Counter.svelte', [['<style>', '<style lang="scss">']]);
update_component(cwd, 'src/routes/index.svelte', [['<style>', '<style lang="scss">']]);
add_svelte_preprocess_to_config(cwd);
console.log(
Expand Down
2 changes: 1 addition & 1 deletion packages/create-svelte/cli/modifications/add_typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default async function add_typescript(cwd, yes) {
tslib: '^2.0.0',
'svelte-preprocess': '^4.0.0'
});
update_component(cwd, 'src/components/Counter.svelte', [
update_component(cwd, 'src/lib/Counter.svelte', [
['<script>', '<script lang="ts">'],
['let count = 0', 'let count: number = 0']
]);
Expand Down
2 changes: 1 addition & 1 deletion packages/create-svelte/ts-template/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"checkJs": true,
"paths": {
"$app/*": [".svelte/dev/runtime/app/*", ".svelte/build/runtime/app/*"],
"$components/*": ["src/components/*"]
"$lib/*": ["src/lib/*"]
}
},
"include": ["src/**/*.js", "src/**/*.ts", "src/**/*.svelte"]
Expand Down

0 comments on commit bb01514

Please sign in to comment.