728x90
// Plugins
import Components from 'unplugin-vue-components/vite'
import Vue from '@vitejs/plugin-vue'
import Vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
import ViteFonts from 'unplugin-fonts/vite'
// Utilities
import { defineConfig } from 'vite'
import { fileURLToPath, URL } from 'node:url'
import dns from 'dns'
dns.setDefaultResultOrder('verbatim')
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
Vue({
template: { transformAssetUrls }
}),
// https://github.com/vuetifyjs/vuetify-loader/tree/master/packages/vite-plugin#readme
Vuetify(),
Components(),
ViteFonts({
google: {
families: [{
name: 'Roboto',
styles: 'wght@100;300;400;500;700;900',
}],
},
}),
],
define: { 'process.env': {} },
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
},
extensions: [
'.js',
'.json',
'.jsx',
'.mjs',
'.ts',
'.tsx',
'.vue',
],
},
server: {
port: 3000,
host: true // 요기 <<<<<<<<<<<<<<<<<<<<<<<
},
})
server 옵션의 host값을
true로 줘야지
모바일에서도 ip로 접근 가능함
'서버' 카테고리의 다른 글
시놀로지 forever로 background 실행 (0) | 2024.03.19 |
---|---|
시놀로지) nginx로 정적페이지만 제공(vue프로젝트 프론트 서버) (0) | 2024.03.11 |
nas) express.js git clone 하여 서버 실행하기(백그라운드로 서버 켜두기) (0) | 2024.03.11 |
aws ec2) spring에서 s3업로드시 "profile file cannot be null"오류현상 (1) | 2024.03.06 |
aws ec2) 로드밸런서 말고 nginx로 ssl 적용시키기 (ubuntu) (0) | 2024.03.02 |