-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathrollup.config.js
48 lines (45 loc) · 1.43 KB
/
rollup.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { nodeResolve } from '@rollup/plugin-node-resolve';
import { terser } from "rollup-plugin-terser";
import replace from '@rollup/plugin-replace'
import typescript from '@rollup/plugin-typescript'
import rollupUrl from '@rollup/plugin-url';
import commonjs from '@rollup/plugin-commonjs';
var componentPath
var serverPath
if ((process.env.BUILD !== 'production')) {
componentPath = "https://blair-vue-apps.ngrok.io/vue-apps/";
serverPath = "https://blair-core.ngrok.io/build/";
} else {
componentPath = "https://resources.realitymedia.digital/vue-apps/";
serverPath = "https://resources.realitymedia.digital/core-components/";
}
export default ['index', 'main-room'].map((name, index) => ({
input: `src/rooms/${name}.ts`,
context: 'window',
output: [{
file: `./build/${name}.js`,
format: 'es',
sourcemap: 'inline'
},
{
file: `./build/${name}.min.js`,
format: 'es',
plugins: [terser()]
}],
external: [ componentPath + "dist/hubs.js" ],
plugins: [
commonjs(),
nodeResolve(),
replace({
preventAssignment: true,
'https://resources.realitymedia.digital/vue-apps/': componentPath //JSON.stringify( componentPath )
}),
typescript({
typescript: require('typescript'),
}),
rollupUrl({
limit: 1000,
publicPath: serverPath,
}),
]
}));