webpack.config.js 897 Bytes
'use strict';

const webpack = require('webpack');
const path = require('path');
const _ = require('lodash');
const version = require('./package.json').version;
const UglifyJsParallelPlugin = require('webpack-uglify-parallel');
const os = require('os');

module.exports = {
    entry: {
        'yas': './yas.js',
        'reporter': './src/reporter/index.js',
        'perf': './src/reporter/perf-reporter.js'
    },
    output: {
        path: path.join('dist', 'yas-jssdk', version), // absolute path
        filename: '[name].js'
    },
    module: {
        loaders: [{
            test: /\.css$/, loader: "style-loader!css-loader"
        }],
        resolve: {
            modulesDirectories: ['node_modules']
        }
    },
    plugins: [
        new webpack.optimize.OccurenceOrderPlugin(),
        new UglifyJsParallelPlugin({
            workers: os.cpus().length
        })
    ]
};