Skip to content
Snippets Groups Projects
Commit c0b7d6fa authored by Giildo's avatar Giildo
Browse files

:green_heart: Add pages ci

parent 17fcd905
Branches
Tags
No related merge requests found
Pipeline #325690 passed with stages
in 2 minutes and 3 seconds
......@@ -3,6 +3,7 @@ image: node:lts
stages:
- build
- test
- deploy
before_script:
- npm install -g pnpm
......@@ -20,7 +21,6 @@ build:
- if [ -d dist ]; then rm -rf dist; fi
- if [ -f pnpm-workspace.yaml ]; then rm pnpm-workspace.yaml; fi
- echo -e "packages:\n - 'libs/*'" > pnpm-workspace.yaml
- mkdir libs
- git clone https://gitlab-ci-token:@git.unistra.fr/vue-unistra/limitdayjs.git libs/limitdayjs
- cd libs/limitdayjs
- git switch develop
......@@ -46,4 +46,21 @@ unit_test:
- pnpm i
- pnpm exec playwright install && pnpm exec playwright install-deps
- pnpm test:coverage
coverage: /All files\s*\|\s*([\d\.]+)/
\ No newline at end of file
coverage: /All files\s*\|\s*([\d\.]+)/
when: on_success
pages:
stage: deploy
tags:
- cluster
only:
- main
- develop
script:
- pnpm i
- pnpm build:app
- rm -rf public
- mv dist public
artifacts:
paths:
- public
\ No newline at end of file
......@@ -28,6 +28,7 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"build:app": "vite build --mode app",
"test": "vitest --project unit --project e2e",
"test:unit": "vitest --project unit --ui",
"test:e2e": "vitest --project e2e",
......
import { defineConfig } from 'vite'
import { defineConfig, type UserConfig } from 'vite'
import { fileURLToPath } from 'node:url'
import { resolve } from 'node:path'
import { visualizer } from 'rollup-plugin-visualizer'
// https://vitejs.dev/config/
export default defineConfig({
const appConfig = (): UserConfig => ({
plugins: [
visualizer({
filename: './visualizer/stats.html',
......@@ -30,19 +29,34 @@ export default defineConfig({
build: {
sourcemap: true,
target: 'esnext',
lib: {
entry: resolve(__dirname, 'src/timeline/Timeline.ts'),
name: 'timeline',
fileName: 'timeline',
},
rollupOptions: {
external: ['uuid', '@vue-unistra/limitdayjs'],
output: {
globals: {
uuid: 'uuid',
'@vue-unistra/limitdayjs': '@vue-unistra/limitdayjs',
},
},
},
},
})
const libConfig = () => {
const config = appConfig()
const lib = {
entry: resolve(__dirname, 'src/timeline/Timeline.ts'),
name: 'timeline',
fileName: 'timeline',
}
const rollupOptions = {
external: ['uuid', '@vue-unistra/limitdayjs'],
output: {
globals: {
uuid: 'uuid',
'@vue-unistra/limitdayjs': '@vue-unistra/limitdayjs',
},
},
}
config.build.lib = lib
config.build.rollupOptions = rollupOptions
return config
}
// https://vitejs.dev/config/
export default ({ mode }) => {
return defineConfig(mode === 'app' ? appConfig() : libConfig())
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment