-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
75 lines (72 loc) · 2.74 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// ========================================================================
// WEBPACK CONFIGURATION FILE
// ========================================================================
const webpack = require('webpack');
const path = require('path');
const CommonsChunkPlugin = webpack.optimize.CommonsChunkPlugin;
const config = {
entry: {
'amplify/public/amplify.min':
['./templates/main/amplify/source/amplify.js'],
'search/public/search.min':
['./templates/main/search/source/search.js'],
'booking/public/booking-funnel.min':
['babel-polyfill','./templates/main/booking/source/booking-funnel.js'],
'offer-search/public/offer-search.min':
['./templates/main/offer-search/source/offer-search.js'],
},
plugins: [
new CommonsChunkPlugin({
name: 'commons',
filename: './js/app-commons.min.js'
})
],
output: {
filename: '[name].js',
path: path.resolve(__dirname, './templates/main')
},
module: {
loaders: [
{
test: /.json$/,
loader: 'babel-loader!json-loader'
},
{
test: /node_modules\/*.(^.json)$/,
loader: 'imports-loader?jquery=jquery!imports-loader?jQuery=jquery!imports-loader?$=jquery'
},
{
test: /foundation-sites/,
loader: 'expose-loader?Foundation!exports-loader?Foundation!imports-loader?jQuery=jquery&$=jquery'
},
{
test: /\.js$/,
exclude: /(disposables|parsley)/,
loader: "babel-loader!eslint-loader"
},
{
test: /\.html$/,
loader: 'vue-html-loader'
}
],
},
externals: {
// 'jquery': 'jQuery'
},
resolve: {
alias: {
'shared': path.resolve(__dirname, 'templates/main/js/shared/'),
'vue$': 'vue/dist/vue.js',
'vee-validate$': 'vee-validate/dist/vee-validate.min.js',
'vue-resource$': 'vue-resource/dist/vue-resource.min.js',
'vue-router$': 'vue-router/dist/vue-router.min.js',
// 'flickity$': 'flickity/dist/flickity.pkgd.min.js',
'jquery.cookiebar': path.resolve(__dirname, 'templates/main/lib/sabre/js/jquery.cookiebar.js'),
'jquery.datepick': path.resolve(__dirname, 'templates/main/lib/sabre/js/jquery.datepick.js'),
'jquery.datepick.ext': path.resolve(__dirname, 'templates/main/lib/sabre/js/jquery.datepick.ext.js'),
'js-cookie$' : 'js-cookie/src/js.cookie.js',
'TweenLite': 'gsap/TweenLite'
},
},
};
module.exports = config;