forked from scsibug/class-central
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
111 lines (110 loc) · 3.06 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
const webpack = require("webpack");
const ModernizrWebpackPlugin = require('modernizr-webpack-plugin');
module.exports = {
context: __dirname + '/src/ClassCentral/SiteBundle/Resources/public/client',
entry: {
'cc': './CC.js',
'cc-legacy': './Legacy.less',
'analytics': './Analytics.js',
'cc-style': './Style.less',
'cc-admin': './Admin.js',
'cc-admin-style': './AdminStyle.less',
'section-help-guides': './styles/help-guides.less',
'section-course': './styles/course.less',
},
resolve: {
alias: {
'handlebars' : 'handlebars/dist/handlebars.js'
},
extensions: ['.js', '.jsx', '.es6', '.less', '.css'],
modules: ['node_modules', 'client']
},
module: {
rules: [
{
test: /modernizr/,
loader: 'imports-loader?this=>window!exports-loader?window.Modernizr'
},
{
test: /flexslider/,
loader: 'imports-loader?this=>window!exports-loader?window.jQuery'
},
{
test: /classcentral/,
loader: 'imports-loader?this=>window!exports-loader?window.loadRaty!exports-loader?window.courseListCheckboxHandler'
},
{
test: /Keen/,
loader: 'imports-loader?this=>window'
},
{
test: /packages\/analytics\/Analytics/,
loader: 'imports-loader?this=>window'
},
{
test: __dirname + 'node_modules/blueimp-file-upload/js/vendor/jquery.ui.widget.js',
loader: 'imports-loader?define=>false&exports=>false!blueimp-file-upload/js/vendor/jquery.ui.widget.js'
},
{
test: __dirname + 'node_modules/blueimp-file-upload/js/jquery.iframe-transport.js',
loader: 'imports-loader?define=>false&exports=>false!blueimp-file-upload/js/jquery.iframe-transport.js'
},
{
test: __dirname + 'node_modules/blueimp-file-upload/js/jquery.fileupload.js',
loader: 'imports-loader?define=>false&exports=>false!blueimp-file-upload/js/jquery.fileupload.js'
},
{
test: require.resolve('js-cookie'),
loader: 'expose-loader?Cookies'
},
{
test: require.resolve('ismobilejs'),
loader: 'expose-loader?isMobile'
},
{
test: require.resolve('countup.js'),
loader: 'expose-loader?countUp'
},
{
test: require.resolve('jquery'),
loader: 'expose-loader?jQuery!expose-loader?$'
},
{
test: /^cc\.js$/,
loader: 'expose-loader?CC'
},
{
test: [
/\.jsx?$/,
/\.es6?$/
],
exclude: /(node_modules|server)/,
use: {
loader: 'babel-loader',
}
}
]
},
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
}),
new ModernizrWebpackPlugin({
filename: 'modernizr.js',
"options": [
"html5shiv",
"prefixes",
"testStyles"
],
"feature-detects": [
"forms/formattribute",
"forms/placeholder",
"inputtypes",
"svg",
"svg/clippaths",
"svg/inline"
]
})
]
};