-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
executable file
·123 lines (101 loc) · 4.36 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/* eslint-disable no-console */
// rollup.config.js fuer SpeechService
import typescript from 'rollup-plugin-typescript2';
import json from '@rollup/plugin-json';
import commonjs from '@rollup/plugin-commonjs';
import nodeResolve from '@rollup/plugin-node-resolve';
import { terser } from 'rollup-plugin-terser';
// SpeechFramework
import * as speechVersion from './config/speech-version.json';
const SPEECH_VERSION_STRING = speechVersion.SPEECH_VERSION_NUMBER + '.' + speechVersion.SPEECH_VERSION_BUILD + ' (' + speechVersion.SPEECH_VERSION_TYPE + ') vom ' + speechVersion.SPEECH_VERSION_DATE;
console.log('');
console.log('*******************************************************************');
console.log('** **');
console.log('** Speech-Framework VERSION: ' + SPEECH_VERSION_STRING + ' **');
console.log('** **');
console.log('*******************************************************************');
console.log('');
// Parameter fuer die Erzeugung der SpeechDialog..bundle.js Datei
let readableSourceCode = true; // true, wenn Code lesbar sein soll, false sonst (uglify/minify)
let preambleText =
`/**
* Speech-Framework
*
* Version: ${speechVersion.SPEECH_VERSION_NUMBER}
* Build: ${speechVersion.SPEECH_VERSION_BUILD}
* TYPE: ${speechVersion.SPEECH_VERSION_TYPE}
* Datum: ${speechVersion.SPEECH_VERSION_DATE}
*
* Autor: LinguaLogic Team
* Lizenz: MIT
*
* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
`;
let typescriptDefaults = { compilerOptions: { declaration: true } };
let typescriptOverride = { compilerOptions: { declaration: false } };
export default {
input: 'index.ts',
output: {
file: './build/speech-framework.js',
format: 'umd',
name: 'speech',
sourcemap: false,
globals: {
}
},
plugins: [
typescript({
tsconfigDefaults: typescriptDefaults,
tsconfig: 'tsconfig.build.json',
tsconfigOverride: typescriptOverride
}),
json(),
terser({
output: {
beautify: readableSourceCode,
preamble: preambleText,
quote_style: 3
}
}),
nodeResolve({
mainFields: ['module', 'main']
}),
commonjs({
// non-CommonJS modules will be ignored, but you can also
// specifically include/exclude files
include: [
'./src/cloud/**',
'./node_modules/**'],
// Default: undefined
// exclude: ['node_modules/**'], // Default: undefined
// these values can also be regular expressions
// include: /node_modules/
// search for files other than .js files (must already
// be transpiled by a previous plugin!)
extensions: ['.js', '.ts'], // Default: [ '.js' ]
// if true then uses of `global` won't be dealt with by this plugin
ignoreGlobal: false, // Default: false
// if false then skip sourceMap generation for CommonJS modules
sourceMap: false, // Default: true
// explicitly specify unresolvable named exports
// (see below for more details)
/*
namedExports: {
'node_modules/rxjs/Observable.js': [ 'Observable' ],
'node_modules/rxjs/Subject': [ 'Subject' ] } // Default: undefined
*/
// sometimes you have to leave require statements
// unconverted. Pass an array containing the IDs
// or a `id => boolean` function. Only use this
// option if you know what you're doing!
//ignore: [ 'conditional-runtime-dependency' ]
})
],
};