From 2d83529751c40a22a03aa104b629d9a11cb0fcd3 Mon Sep 17 00:00:00 2001 From: Yatish Mehta Date: Thu, 18 Apr 2024 22:24:47 -0700 Subject: [PATCH] Added config to Vite --- Gemfile | 3 +-- bin/setup | 2 +- vite.config.js | 22 ++++++++++++++++++++++ vite.config.ts | 14 -------------- 4 files changed, 24 insertions(+), 17 deletions(-) create mode 100644 vite.config.js delete mode 100644 vite.config.ts diff --git a/Gemfile b/Gemfile index d5a2ea7..736c753 100644 --- a/Gemfile +++ b/Gemfile @@ -27,6 +27,5 @@ group :development do gem "rubocop-performance", require: false gem "rubocop-rails", ">= 2.22.0", require: false gem "web-console" + gem "foreman", "~> 0.88.1" end - -gem "foreman", "~> 0.88.1" diff --git a/bin/setup b/bin/setup index 70ca357..28e17e8 100755 --- a/bin/setup +++ b/bin/setup @@ -106,4 +106,4 @@ end Dir.chdir(File.expand_path("..", __dir__)) do setup! -end +end \ No newline at end of file diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..e0c9883 --- /dev/null +++ b/vite.config.js @@ -0,0 +1,22 @@ +import { defineConfig } from "vite"; +import { resolve } from "path"; +import ViteRails from "vite-plugin-rails"; + +export default defineConfig({ + plugins: [ + ViteRails({ + envVars: { RAILS_ENV: "development" }, + envOptions: { defineOn: "import.meta.env" }, + fullReload: { + additionalPaths: ["config/routes.rb", "app/views/**/*"], + delay: 300, + }, + }), + ], + build: { sourcemap: false }, + resolve: { + alias: { + "@assets": resolve(__dirname, "app/frontend"), + }, + }, +}); diff --git a/vite.config.ts b/vite.config.ts deleted file mode 100644 index a711864..0000000 --- a/vite.config.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { defineConfig } from 'vite' -import ViteRails from "vite-plugin-rails" - -export default defineConfig({ - plugins: [ - ViteRails({ - envVars: { RAILS_ENV: "development" }, - envOptions: { defineOn: "import.meta.env" }, - fullReload: { - additionalPaths: [], - }, - }), - ], -})