smart-view
Version:
Moq (mobile quality assessment) is a tool used to measure an online ad viewability
47 lines (42 loc) • 1.11 kB
JavaScript
var webpack = require('webpack'),
path = require('path'),
yargs = require('yargs');
var libraryName = 'smartview',
plugins = [],
outputFile;
if (yargs.argv.p) {
plugins.push(new webpack.optimize.UglifyJsPlugin({ minimize: false }));
outputFile = libraryName + '.min.js';
} else {
outputFile = libraryName + '.js';
}
var config = {
entry: [
__dirname + '/index.ts'
],
devtool: 'source-map',
output: {
path: path.join(__dirname, '/dist'),
filename: outputFile,
libraryTarget: 'umd',
umdNamedDefine: true
},
module: {
preLoaders: [
{ test: /\.tsx?$/, loader: 'tslint', exclude: /node_modules/ }
],
loaders: [
{ test: /\.tsx?$/, loader: 'ts', exclude: /node_modules/ }
]
},
resolve: {
root: path.resolve('./src'),
extensions: ['', '.js', '.ts', '.jsx', '.tsx']
},
plugins: plugins,
tslint: {
emitErrors: true,
failOnHint: true
}
};
module.exports = config;