forked from wayfair-archive/tungstenjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.standalone.js
38 lines (34 loc) · 1016 Bytes
/
webpack.standalone.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* eslint-env node */
'use strict';
var webpackSettings = require('./webpack-helper');
var path = require('path');
module.exports = function(options) {
// set adaptor with --adaptor=adaptor_name
// set debug mode with --dev=true
// default is backbone
var adaptor = options.adaptor || 'backbone';
var devStr = options.dev ? '.debug' : '';
// Target environment (eg: web browsers, nodejs)
// https://webpack.github.io/docs/configuration.html#target
var envStr = options.env || 'web';
return webpackSettings.compileSource({
entry: './adaptors/' + adaptor,
output: {
filename: './dist/tungsten.' + adaptor + devStr + '.' + envStr + '.js',
libraryTarget: 'umd',
library: 'tungsten'
},
target: envStr,
resolve: {
alias: {
jquery: path.join(__dirname, './src/polyfill/jquery')
}
},
resolveLoader: {
modules: [path.join(__dirname, 'node_modules')]
},
module: {
loaders: []
}
}, options.dev, options.test);
};