Created
May 2, 2023 14:59
-
-
Save dmix/4059efd362348c6654ea29a111bdd081 to your computer and use it in GitHub Desktop.
vite.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vite.config.ts | |
``` | |
import { configDefaults, defineConfig } from 'vitest/config' | |
import RubyPlugin from 'vite-plugin-ruby' | |
import vue from '@vitejs/plugin-vue' | |
import vueJsx from '@vitejs/plugin-vue-jsx' | |
import path from 'path' | |
export default defineConfig({ | |
plugins: [RubyPlugin(), vue(), vueJsx()], | |
resolve: { | |
alias: { | |
'element-index': path.resolve( | |
__dirname, | |
'node_modules/element-plus/theme-chalk/src/index.scss', | |
), | |
vue: 'vue/dist/vue.esm-bundler.js', | |
'/~': path.resolve(__dirname, 'node_modules'), | |
'/@': __dirname, | |
}, | |
}, | |
build: { | |
sourcemap: false, | |
}, | |
css: { | |
devSourcemap: true, | |
}, | |
test: { | |
exclude: [...configDefaults.exclude], | |
globals: true, | |
environment: 'jsdom', | |
include: ['__tests__/**/*_{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], | |
deps: { | |
registerNodeLoader: false, | |
}, | |
// setupFiles: './app/javascript/__tests__/setupTests.ts', | |
// exclude: [ | |
// 'node_modules/', | |
// './app/javascript/__tests__/setupTests.ts', | |
// ], | |
}, | |
}) | |
``` | |
vite.json: | |
``` | |
{ | |
"all": { | |
"additionalEntrypoints": ["~/{assets,fonts,icons,images}/**/*"], | |
"assetsDir": "assets", | |
"publicOutputDir": "vite", | |
"sourceCodeDir": "app/javascript", | |
"viteBinPath": "node_modules/.bin/vite", | |
"watchAdditionalPaths": ["config/**/*"] | |
}, | |
"development": { | |
"autoBuild": true, | |
"port": 3036 | |
}, | |
"test": { | |
"autoBuild": true, | |
"port": 3037 | |
}, | |
"production": { | |
"autoBuild": false | |
} | |
} | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment