1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-16 07:38:18 +09:00
cherrypick/webpack/plugins/index.ts
2018-02-18 18:49:44 +09:00

23 lines
446 B
TypeScript

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;
};