Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vite #207

Merged
merged 5 commits into from
Dec 11, 2023
Merged

Vite #207

Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
More vite configuration
MelissaAutumn committed Dec 8, 2023
commit c7aa182037d4ca1084d476280937350599a7c91d
16 changes: 8 additions & 8 deletions frontend/.env.example
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Appointment frontend configuration.

# -- Frontend --
VUE_APP_BASE_URL=localhost:8080
VUE_APP_SHORT_BASE_URL=localhost:8080/user
VITE_BASE_URL=localhost:8080
VITE_SHORT_BASE_URL=localhost:8080/user

# -- Backend API --
VUE_APP_API_URL=localhost
VUE_APP_API_PORT=8090
VUE_APP_API_SECURE=false
VITE_API_URL=localhost
VITE_API_PORT=8090
VITE_API_SECURE=false

# -- Sentry --
VUE_APP_SENTRY_DSN=
VITE_SENTRY_DSN=

# -- Auth scheme --
VUE_APP_AUTH_SCHEME=password
VITE_AUTH_SCHEME=password

# For fxa
VUE_APP_FXA_EDIT_PROFILE=
VITE_FXA_EDIT_PROFILE=
12 changes: 6 additions & 6 deletions frontend/.env.staging.example
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Production env config, do not put secrets in here !!
VUE_APP_API_URL=stage.appointment.day/api/v1/
VUE_APP_BASE_URL=stage.appointment.day
VUE_APP_API_SECURE=true
VUE_APP_SHORT_BASE_URL=https://stage.apmt.day
VITE_API_URL=stage.appointment.day/api/v1/
VITE_BASE_URL=stage.appointment.day
VITE_API_SECURE=true
VITE_SHORT_BASE_URL=https://stage.apmt.day

# -- Auth scheme --
VUE_APP_AUTH_SCHEME=fxa
VITE_AUTH_SCHEME=fxa

# For fxa
VUE_APP_FXA_EDIT_PROFILE=https://accounts.stage.mozaws.net/settings
VITE_FXA_EDIT_PROFILE=https://accounts.stage.mozaws.net/settings
69 changes: 35 additions & 34 deletions frontend/.eslintrc.js → frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
'plugin:vue/vue3-essential',
'airbnb-base',
],
overrides: [],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: [
'vue',
],
rules: {
'import/extensions': ['error', 'ignorePackages', {
'': 'never',
js: 'never',
vue: 'off', // TODO: once migrated to Vite, we should set this to 'always'
}],
'max-len': ['error', { code: 120 }],
'no-param-reassign': 'off',
},
settings: {
'import/resolver': {
webpack: {
config: require.resolve('@vue/cli-service/webpack.config.js'),
},
},
},
};
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
'plugin:vue/vue3-essential',
'airbnb-base',
],
overrides: [],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: [
'vue',
],
rules: {
'import/extensions': ['error', 'ignorePackages', {
'': 'never',
js: 'never',
vue: 'off', // TODO: once migrated to Vite, we should set this to 'always'
}],
'max-len': ['error', { code: 120 }],
'no-param-reassign': 'off',
},
settings: {
// This uses the default `vite.config.js` file and the Vite configuration is an object.
'import/resolver': {
vite: {
namedExport: 'viteConfig',
},
},
},
};
3 changes: 3 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -22,3 +22,6 @@ pnpm-debug.log*
*.njsproj
*.sln
*.sw?

# Sentry Config File
.env.sentry-build-plugin
28 changes: 18 additions & 10 deletions frontend/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
import { fileURLToPath, URL } from 'node:url'
import { sentryVitePlugin } from '@sentry/vite-plugin';
import { fileURLToPath, URL } from 'node:url';

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
],
plugins: [vue(), sentryVitePlugin({
org: 'thunderbird',
project: 'appointment-frontend',
})],

resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
extensions: ['.js', '.vue'],
},

server: {
host: '0.0.0.0'
}
})
host: '0.0.0.0',
},

build: {
sourcemap: true,
},
});
27 changes: 0 additions & 27 deletions frontend/vue.config.js

This file was deleted.