-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
99 lines (98 loc) · 2.94 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
var HtmlWebpackPlugin = require('html-webpack-plugin')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin')
var UglifyJSPlugin = require('uglifyjs-webpack-plugin')
var Path = require('path')
module.exports = {
entry: './src/index.js',
output: {
path: __dirname + '/docs/',
filename: 'index.bundle.js'
},
module: {
rules: [{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader', 'sass-loader']
})
},
{
test: /\.js$/,
exclude: /node_modules/,
use: [{
loader: 'babel-loader'
}
/*, {
loader: 'eslint-loader',
options: {
emitWarning: true
}
}*/
]
},
{
test: /\.(jpg|png|woff(2)?|svg)$/,
loader: 'file-loader'
},
{
test: /\.pdf$/,
loader: 'file-loader',
options: {
name: '[name].[ext]'
}
}
]
},
resolve: {
alias: {
"TweenLite": Path.resolve('node_modules', 'gsap/src/uncompressed/TweenLite.js'),
"TweenMax": Path.resolve('node_modules', 'gsap/src/uncompressed/TweenMax.js'),
"TimelineLite": Path.resolve('node_modules', 'gsap/src/uncompressed/TimelineLite.js'),
"TimelineMax": Path.resolve('node_modules', 'gsap/src/uncompressed/TimelineMax.js'),
"ScrollMagic": Path.resolve('node_modules', 'scrollmagic/scrollmagic/uncompressed/ScrollMagic.js'),
"animation.gsap": Path.resolve('node_modules', 'scrollmagic/scrollmagic/uncompressed/plugins/animation.gsap.js'),
"debug.addIndicators": Path.resolve('node_modules', 'scrollmagic/scrollmagic/uncompressed/plugins/debug.addIndicators.js')
}
},
plugins: [
new HtmlWebpackPlugin({
title: 'CruzHacks 2018 | Create something that makes a difference.',
favicon: __dirname + '/src/images/favicon.png',
minify: {
collapseWhitespace: true,
removeComments: true,
removeScriptTypeAttributes: true,
removeAttributeQuotes: true,
useShortDoctype: true,
minifyCSS: true
},
template: './src/index.html'
}),
new HtmlWebpackPlugin({
title: 'CruzHacks 2018 | Winners',
favicon: __dirname + '/src/images/favicon.png',
minify: {
collapseWhitespace: true,
removeComments: true,
removeScriptTypeAttributes: true,
removeAttributeQuotes: true,
useShortDoctype: true,
minifyCSS: true
},
template: './src/winners.html',
filename: 'winners.html'
}),
new ExtractTextPlugin({
filename: 'style.[contenthash].css'
}),
new OptimizeCssAssetsPlugin({
cssProcessorOptions: {
discardComments: {
removeAll: true
}
}
}),
//new UglifyJSPlugin()
]
}