forked from wayfair-archive/tungstenjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
44 lines (42 loc) · 1.14 KB
/
webpack.config.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
39
40
41
42
43
44
/* eslint-env node */
var webpack = require('webpack');
var path = require('path');
module.exports = function(options) {
return {
output: {
libraryTarget: 'var',
library: 'tungsten'
//
// -- For AMD output --
// libraryTarget: 'amd'
// library: 'tungsten', // For named AMD, uncomment this line
//
// -- For UMD output --
// libraryTarget: 'umd',
// library: 'tungsten'
},
resolve: {
alias: {
'jquery': path.join(__dirname, './src/polyfill/jquery')
}
},
devtool: '#source-map',
resolveLoader: {
modules: [path.join(__dirname, 'node_modules'), path.join(__dirname, 'precompile')]
},
plugins: [
new webpack.DefinePlugin({
TUNGSTENJS_VERSION: JSON.stringify(require('./package.json').version),
TUNGSTENJS_DEBUG_MODE: options.dev || undefined,
TUNGSTENJS_IS_TEST: options.test
})
],
module: {
loaders: [
{test: /\.js$/, loader: 'babel', exclude: /node_modules/},
{test: /\.mustache$/, loader: 'tungsten_template'},
{test: /\.json$/, loader: 'json-loader'}
]
}
};
};