summaryrefslogtreecommitdiff
path: root/webpack/plugins/index.ts
blob: 027f60224f27d8d9353cd501ab22eecd97e535d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');

import consts from './consts';
import hoist from './hoist';
import minify from './minify';

const env = process.env.NODE_ENV;
const isProduction = env === 'production';

export default (version, lang) => {
	const plugins = [
		//new HardSourceWebpackPlugin(),
		consts(lang)
	];

	if (isProduction) {
		plugins.push(hoist());
		plugins.push(minify());
	}

	return plugins;
};