module.exports = {
	// Global page headers: https://go.nuxtjs.dev/config-head
	ssr: false,
	head: {
		titleTemplate: '%s',
		title: 'FEMS',
		htmlAttrs: {
			lang: 'ko',
		},
		meta: [
			{ charset: 'utf-8' },
			{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
			{ hid: 'description', name: 'description', content: '' },
		],
		link: [
			// { rel: "stylesheet", type: "text/css", href: "assets/css/SpoqaHanSansNeo.css" },
			{ rel: 'icon', type: 'image/x-icon', href: '/skfavicon.ico' },
		],
	},

	// Global CSS: https://go.nuxtjs.dev/config-css
	css: ['~assets/scss/common.scss', '~assets/css/SpoqaHanSansNeo.css','~assets/css/Oxanium.css'],

	// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
	plugins: [
		'~/plugins/axios',
		'~/plugins/eChart.js',
		'~/plugins/grid',
		'~/plugins/vue-fullscreen',
		'~/plugins/jqxGrid',
		'~/plugins/routerTab',
		'~/plugins/vCalendar',
		'~/plugins/datepicker',
		'~/plugins/message',
		'~/plugins/ant-design-vue'
	],
	router: {
		middleware: ['middleRouter'],
		extendRoutes(routes, resolve) {
			// add Iframe route
			routes.push({
				name: 'iframe',
				path: '/iframe/:src/:title?/:icon?',
				component: resolve(__dirname, 'pages/-Iframe.js'),
				props: true,
			});
		},
	},

	// Auto import components: https://go.nuxtjs.dev/config-components
	components: true,

	// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
	buildModules: [
		// https://go.nuxtjs.dev/vuetify
		'@nuxtjs/vuetify',
	],

	// Modules: https://go.nuxtjs.dev/config-modules
	modules: ['@nuxtjs/axios', '@nuxtjs/dayjs', '@nuxtjs/style-resources','@nuxtjs/google-fonts'],
	styleResources: {
		scss: ['./assets/scss/*.scss'],
	},
	proxy: {
	  "/api/": {
	    target: "http://0.0.0.0:9999/",
	    //target: "http://192.168.0.152:8082/",
	    pathRewrite: {
	      "^/api/": ""
	    }
	  }
	},
	axios: {
		//baseURL: "http://dotest.kfems.kr:9997",
		proxy: true,
		headers: {
			common: {
				'X-Requested-With': 'XMLHttpRequest',
			},
		},
	},
	// Optional
	dayjs: {
		locales: ['ko', 'en'],
		defaultLocale: 'ko',
		defaultTimeZone: 'Asia/Seoul',
		plugins: [
			'utc', // import 'dayjs/plugin/utc'
			'timezone', // import 'dayjs/plugin/timezone'
		], // Your Day.js plugin
	},
	module: {
		// mode: 'spa',  //'spa': No server-side rendering (only client-side navigation) //'universal': Isomorphic application (server-side rendering + client-side navigation)
		rules: [
			{
				test: /\.m?js$/,
				exclude: /node_modules/,
				use: {
					loader: 'babel-loader',
					options: {
						presets: [['@babel/preset-env', { targets: 'defaults' }]],
						plugins: ['@babel/plugin-proposal-class-properties'],
					},
				},
			},
		],
	},
	googleFonts: {
		families: {
			Oxanium: [900], // You can add more weights if needed
		},
		display: 'swap',
	},
	// Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify
	vuetify: {
		lang: {
			locales: ['ko', 'en'],
			current: 'ko',
		},
		customVariables: ['~/assets/variables.scss'],
		treeShake: true,
		optionsPath: '~/plugins/vuetify.js',
	},

	// Build Configuration: https://go.nuxtjs.dev/config-build
	build: {
		transpile: [/echarts/, /zrender/, /vue-router-tab/],
		vendor: ['@toast-ui/vue-grid'],
		styleResources: {
			scss: './assets/scss/**/*.scss',
		},
		publicPath: '/_nuxt/comm/',
		cache: true
	},
};
