mon-entreprise/site/vite.config.js

45 lines
1.1 KiB
JavaScript
Raw Normal View History

2021-12-07 08:12:57 +00:00
import yaml from '@rollup/plugin-yaml'
import react from '@vitejs/plugin-react'
import path from 'path'
2021-12-07 12:46:03 +00:00
import toml from 'rollup-plugin-toml'
2021-12-07 08:12:57 +00:00
import { defineConfig } from 'vite'
import { injectHtml } from 'vite-plugin-html'
import { watchDottedNames } from '../modele-social/build.js'
2021-12-27 11:46:40 +00:00
if (process.env.WATCH_MODELE_SOCIAL) {
watchDottedNames()
}
2021-12-07 08:12:57 +00:00
/**
* @type {import('vite').Config}
*/
export default defineConfig({
resolve: {
alias: {
Actions: path.resolve('source/actions/'),
Components: path.resolve('source/components/'),
Selectors: path.resolve('source/selectors/'),
Reducers: path.resolve('source/reducers/'),
Types: path.resolve('source/types/'),
Images: path.resolve('source/static/images/'),
DesignSystem: path.resolve('source/design-system'),
Data: path.resolve('source/data'),
Hooks: path.resolve('source/hooks'),
API: path.resolve('source/api'),
},
extensions: ['.js', '.ts', '.jsx', '.tsx', '.json'],
},
2021-12-27 11:46:40 +00:00
publicDir: 'source/static',
2021-12-07 08:12:57 +00:00
plugins: [
react({
babel: {
plugins: ['babel-plugin-styled-components'],
},
}),
yaml(),
toml,
injectHtml(),
],
build: {},
})