setup proxy for dev

This commit is contained in:
antony 2024-12-23 14:14:44 +07:00
parent 8bacb8406e
commit 5614ed542a
2 changed files with 20 additions and 1 deletions

View File

@ -10,6 +10,16 @@ export default defineNuxtConfig({
preset: "static"
},
vite: {
server: {
proxy: {
"^/node_modules/.*": {
target: "http://localhost:3000",
changeOrigin: true,
rewrite: (path) =>
path.replace(/^\/node_modules\//, "/_nuxt/node_modules/")
}
}
},
$client: {
plugins: [
topLevelAwait({

View File

@ -2,10 +2,19 @@
<div>
<h1>rmt/pages/contact/properties.vue</h1>
<div>Contact prop</div>
<div>
<button type="button" @click="handleClick">Click: {{ counter }}</button>
</div>
</div>
</template>
<script setup>
const counter = ref(0)
const handleClick = () => {
counter.value += 2
}
definePageMeta({
name: "contact1"
name: "contact-properties"
})
</script>