import eslint from 'vite-plugin-eslint' import { createVuePlugin as vue } from 'vite-plugin-vue2' import path from 'path' import glob from 'glob' export default defineConfig(({ command }) => ({ base: '', build: { root: '/', base: '/', manifest: true, outDir: path.resolve(__dirname, 'public/assets'), rollupOptions: { input: glob.sync('resources/js/**/*.ts').map(function (file) { return file }), output: { chunkFileNames: '[name].chunk.js?id=[hash]', }, }, }, plugins: [vue(), laravel(), eslint()], resolve: { alias: [ { find: '@js', replacement: path.resolve(__dirname, 'resources/js'), }, { find: '@img', replacement: path.resolve(__dirname, 'resources/img'), }, { find: '@sass', replacement: path.resolve(__dirname, 'resources/sass'), }, { find: '@node_modules', replacement: path.resolve(__dirname, 'resources/node_modules'), }, { find: /^~(.*)$/, replacement: '$1', }, ], // デフォルトでは.vue が入っていない extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', 'vue'], }, optimizeDeps: { include: ['vue'], }, }))