-
Notifications
You must be signed in to change notification settings - Fork 209
Expand file tree
/
Copy pathrollup.config.mjs
More file actions
55 lines (52 loc) · 1.52 KB
/
rollup.config.mjs
File metadata and controls
55 lines (52 loc) · 1.52 KB
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
49
50
51
52
53
54
55
// rollup.config.mjs
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import terser from '@rollup/plugin-terser';
import typescript from '@rollup/plugin-typescript';
import { readFileSync } from 'fs';
import nodePolyfills from 'rollup-plugin-polyfill-node';
const packageJson = JSON.parse(readFileSync('./package.json', 'utf-8'));
export default [
{
input: './src/index.ts',
output: {
dir: 'dist/esm',
name: '@microsoft/teams-js',
format: 'es',
preserveModules: true,
entryFileNames: '[name].js',
sourcemap: false,
plugins: [terser()],
},
preserveEntrySignatures: 'strict',
plugins: [
nodeResolve({
extensions: ['.js', '.ts', '.d.ts', '.json'],
}),
replace({
preventAssignment: true,
'process.env.NODE_ENV': JSON.stringify('production'),
PACKAGE_VERSION: JSON.stringify(packageJson.version),
}),
typescript(),
json(),
commonjs(),
nodePolyfills(),
],
treeshake: {
moduleSideEffects: [
'src/internal/communication.ts',
'src/internal/nestedAppAuthUtils.ts',
'src/internal/utils.ts',
'src/internal/videoEffectsUtils.ts',
'src/private/constants.ts',
'src/private/interfaces.ts',
'src/public/constants.ts',
'src/public/handlers.ts',
'src/public/interfaces.ts',
],
},
},
];