Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
wre232114 committed Nov 30, 2023
1 parent 0a83fff commit 2bcf360
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .changeset/eighty-cheetahs-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@farmfe/runtime': patch
---

fix #802
5 changes: 5 additions & 0 deletions .changeset/tame-dolphins-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@farmfe/core': patch
---

fix #770
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ swc_html_ast = { version = "0.33.9", features = ["rkyv-impl"] }
heck = "0.4.1"
puffin = { version = "0.17.0", features = ["packing"], optional = true }
regex = "1.7.3"
enhanced-magic-string = { version = "0.0.11" }
enhanced-magic-string = { version = "0.0.12" }

[features]
profile = ["dep:puffin"]
3 changes: 2 additions & 1 deletion examples/vite-adapter-vue/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ export {}
declare module 'vue' {
export interface GlobalComponents {
ElButton: typeof import('element-plus/es')['ElButton']
ElTree: typeof import('element-plus/es')['ElTree']
ElInput: typeof import('element-plus/es')['ElInput']
Formatter: typeof import('./src/components/Formatter.vue')['default']
HelloWorld: typeof import('./src/components/HelloWorld.vue')['default']
Intro: typeof import('./src/components/Intro.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
}
Expand Down
4 changes: 3 additions & 1 deletion examples/vite-adapter-vue/src/components/Formatter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ const format = async () => {
};
</script>

<style scoped></style>
<style lang="scss" scoped>
/* build error */
</style>
8 changes: 2 additions & 6 deletions examples/vite-adapter-vue/src/components/HelloWorld.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script setup lang="ts">
import { ref } from 'vue';
import Intro from './async-comp';
defineProps<{ msg: string }>()
const count = ref(0)
Expand Down Expand Up @@ -91,12 +92,7 @@ const defaultProps = {
</p>
</div>

<p>
Install
<a href="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/vuejs/language-tools" target="_blank">Volar</a>
in your IDE for a better DX
</p>
<p class="read-the-docs">Click on the Farm and Vue logos to learn more</p>
<intro />
</template>

<style scoped lang="scss">
Expand Down
14 changes: 14 additions & 0 deletions examples/vite-adapter-vue/src/components/Intro.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<script lang="ts"></script>

<template>
<p>
Install
<a href="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/vuejs/language-tools" target="_blank">Volar</a>
in your IDE for a better DX
</p>
<p class="read-the-docs">Click on the Farm and Vue logos to learn more</p>
</template>

<style lang="scss" scoped>
/* build error */
</style>
3 changes: 3 additions & 0 deletions examples/vite-adapter-vue/src/components/async-comp.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { defineAsyncComponent } from "vue";

export default defineAsyncComponent(() => import("./Intro.vue"));
4 changes: 3 additions & 1 deletion packages/runtime/src/resource-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ export class ResourceLoader {
}

const publicPath = this.publicPaths[index];
const url = `${publicPath === '/' ? '' : publicPath}/${resource.path}`;
const url = `${
publicPath.endsWith('/') ? publicPath.slice(0, -1) : publicPath
}/${resource.path}`;

if (this._loadedResources[resource.path]) {
return;
Expand Down

0 comments on commit 2bcf360

Please sign in to comment.