summaryrefslogtreecommitdiff
path: root/webpack/webpack.config.ts
blob: 1a516d141925b17f786d2e65774055ab4e13ba4e (plain)
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
/**
 * webpack configuration
 */

import module_ from './module';
import plugins from './plugins';

import langs from '../locales';
import version from '../src/version';

module.exports = Object.keys(langs).map(lang => {
	// Chunk name
	const name = lang;

	// Entries
	const entry = {
		desktop: './src/web/app/desktop/script.ts',
		//mobile: './src/web/app/mobile/script.ts',
		//ch: './src/web/app/ch/script.ts',
		//stats: './src/web/app/stats/script.ts',
		//status: './src/web/app/status/script.ts',
		//dev: './src/web/app/dev/script.ts',
		//auth: './src/web/app/auth/script.ts',
		sw: './src/web/app/sw.js'
	};

	const output = {
		path: __dirname + '/../built/web/assets',
		filename: `[name].${version}.${lang}.js`
	};

	return {
		name,
		entry,
		module: module_(lang),
		plugins: plugins(version, lang),
		output,
		resolve: {
			extensions: [
				'.js', '.ts'
			]
		},
		cache: true
	};
});