|
1072
|
1 |
import { defineConfig } from "vite"; |
|
|
2 |
import banner from "vite-plugin-banner"; |
|
|
3 |
import pkg from "./package.json"; |
|
|
4 |
import { nodePolyfills } from "vite-plugin-node-polyfills"; |
|
|
5 |
import inject from '@rollup/plugin-inject'; |
|
|
6 |
|
|
|
7 |
export default defineConfig({ |
|
|
8 |
build: { |
|
|
9 |
lib: { |
|
|
10 |
// Could also be a dictionary or array of multiple entry points |
|
|
11 |
entry: "./src/main.js", |
|
|
12 |
name: "MetadataPlayer", |
|
|
13 |
// the proper extensions will be added |
|
|
14 |
fileName: (format) => { |
|
|
15 |
if(format == "es") |
|
|
16 |
return "LdtPlayer-core.lib.js" |
|
|
17 |
else |
|
|
18 |
return "LdtPlayer-core.js"; |
|
|
19 |
}, |
|
|
20 |
type: ["es", "cjs", "umd"], |
|
|
21 |
}, |
|
|
22 |
rollupOptions: { |
|
|
23 |
// make sure to externalize deps that shouldn't be bundled |
|
|
24 |
// into your library |
|
|
25 |
external: [], |
|
|
26 |
output: { |
|
|
27 |
// Provide global variables to use in the UMD build |
|
|
28 |
// for externalized deps |
|
|
29 |
globals: {}, |
|
|
30 |
assetFileNames: "LdtPlayer-core.[ext]", |
|
|
31 |
}, |
|
|
32 |
}, |
|
|
33 |
define: { |
|
|
34 |
__APP_VERSION__: JSON.stringify(process.env.npm_package_version), |
|
|
35 |
}, |
|
|
36 |
copyPublicDir: false, |
|
|
37 |
sourcemap: true, |
|
|
38 |
}, |
|
|
39 |
css: { |
|
|
40 |
modules: { |
|
|
41 |
scopeBehaviour: "global", |
|
|
42 |
// localsConvention: "camelCaseOnly" |
|
|
43 |
}, |
|
|
44 |
}, |
|
|
45 |
plugins: [ |
|
|
46 |
{ |
|
|
47 |
...inject({ |
|
|
48 |
$: 'jquery', |
|
|
49 |
jQuery: 'jquery', |
|
|
50 |
}), |
|
|
51 |
enforce:"post", |
|
|
52 |
}, |
|
|
53 |
banner(` |
|
|
54 |
* |
|
|
55 |
__ __ _ _ _ _ |
|
|
56 |
| \\/ | ___| |_ __ _ __| | __ _| |_ __ _ _ __ | | __ _ _ _ ___ _ __ |
|
|
57 |
| |\\/| |/ _ \\ __/ _\` |/ _\` |/ _\` | __/ _\` | '_ \\| |/ _\` | | | |/ _ \\ '__| |
|
|
58 |
| | | | __/ || (_| | (_| | (_| | || (_| | |_) | | (_| | |_| | __/ | |
|
|
59 |
|_| |_|\\___|\\__\\__,_|\\__,_|\\__,_|\\__\\__,_| .__/|_|\\__,_|\\__, |\\___|_| |
|
|
60 |
|_| |___/ |
|
|
61 |
|
|
|
62 |
* Copyright 2010-2024 Institut de Recherche et d'Innovation |
|
|
63 |
* contributor(s) : Karim Hamidou, Samuel Huron, Raphael Velt, Thibaut Cavalie, Yves-Marie Haussonne, Nicolas Durand, Olivier Aubert |
|
|
64 |
* |
|
|
65 |
* contact@iri.centrepompidou.fr |
|
|
66 |
* http://www.iri.centrepompidou.fr |
|
|
67 |
* |
|
|
68 |
* This software is a computer program whose purpose is to show and add annotations on a video . |
|
|
69 |
* This software is governed by the CeCILL-C license under French law and |
|
|
70 |
* abiding by the rules of distribution of free software. You can use, |
|
|
71 |
* modify and/ or redistribute the software under the terms of the CeCILL-C |
|
|
72 |
* license as circulated by CEA, CNRS and INRIA at the following URL |
|
|
73 |
* "http://www.cecill.info". |
|
|
74 |
* |
|
|
75 |
* The fact that you are presently reading this means that you have had |
|
|
76 |
* knowledge of the CeCILL-C license and that you accept its terms. |
|
|
77 |
* ${pkg.name} - version ${pkg.version} |
|
|
78 |
`), |
|
|
79 |
nodePolyfills(), |
|
|
80 |
], |
|
|
81 |
}); |