mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-07 16:34:26 +00:00
Update sass api
This commit is contained in:
@@ -6,24 +6,21 @@ import postcssSimpleVars from 'postcss-simple-vars';
|
|||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig(({ mode }) => ({
|
export default defineConfig(({ mode }) => ({
|
||||||
plugins: [react()],
|
plugins: [
|
||||||
|
react({
|
||||||
|
include: ['**/*.jsx', '**/*.js'],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
|
||||||
// Maintain webpack's entry point behavior
|
|
||||||
root: 'src',
|
root: 'src',
|
||||||
publicDir: '../public',
|
publicDir: '../public',
|
||||||
|
|
||||||
build: {
|
build: {
|
||||||
// Output to the same directory as webpack
|
|
||||||
outDir: '../dist',
|
outDir: '../dist',
|
||||||
emptyOutDir: true,
|
emptyOutDir: true,
|
||||||
|
|
||||||
// Configure asset handling
|
|
||||||
assetsDir: 'assets',
|
assetsDir: 'assets',
|
||||||
|
|
||||||
// Generate sourcemaps in development
|
|
||||||
sourcemap: mode === 'development',
|
sourcemap: mode === 'development',
|
||||||
|
|
||||||
// Configure rollup options
|
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
input: {
|
input: {
|
||||||
main: path.resolve(__dirname, 'src/index.html'),
|
main: path.resolve(__dirname, 'src/index.html'),
|
||||||
@@ -31,21 +28,23 @@ export default defineConfig(({ mode }) => ({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
// Server configuration (dev only)
|
|
||||||
server: {
|
server: {
|
||||||
port: 3000,
|
port: 3000,
|
||||||
open: true,
|
open: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
// Define environment variables
|
|
||||||
define: {
|
define: {
|
||||||
'window.API_BASE_URL': JSON.stringify(
|
'window.API_BASE_URL': JSON.stringify(
|
||||||
mode === 'production' ? '/api/v1' : 'http://localhost:8080/api/v1'
|
mode === 'production' ? '/api/v1' : 'http://localhost:8080/api/v1'
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
||||||
// CSS configuration
|
|
||||||
css: {
|
css: {
|
||||||
|
preprocessorOptions: {
|
||||||
|
scss: {
|
||||||
|
api: 'modern',
|
||||||
|
},
|
||||||
|
},
|
||||||
postcss: {
|
postcss: {
|
||||||
plugins: [
|
plugins: [
|
||||||
postcssPresetMantine(),
|
postcssPresetMantine(),
|
||||||
@@ -66,5 +65,6 @@ export default defineConfig(({ mode }) => ({
|
|||||||
alias: {
|
alias: {
|
||||||
'@': path.resolve(__dirname, './src'),
|
'@': path.resolve(__dirname, './src'),
|
||||||
},
|
},
|
||||||
|
extensions: ['.js', '.jsx', '.json'],
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|||||||
Reference in New Issue
Block a user