forked from MozillaReality/webxr-ios-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
42 lines (37 loc) · 1008 Bytes
/
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
/**
* Copyright (c) 2019 Mozilla Inc. All Rights Reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import fs from 'fs';
import path from 'path';
import replace from 'rollup-plugin-replace';
import cleanup from 'rollup-plugin-cleanup';
import commonjs from 'rollup-plugin-commonjs';
import resolve from 'rollup-plugin-node-resolve';
const banner = fs.readFileSync(path.join(__dirname, 'licenses.txt'));
export default [
{
input: 'src/webxr.js',
output: {
file: './dist/webxr.js',
format: 'umd',
name: 'WebXRPolyfill',
banner: banner
},
plugins: rollupPlugins()
}]
function rollupPlugins() {
return [
replace({
'process.env.NODE_ENV': JSON.stringify('production'),
}),
commonjs(),
resolve(),
cleanup({
comments: 'none',
})
];
}