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

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

module.exports = {
    entry: {
        'yas': './yas.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
        })
    ]
};