-
Notifications
You must be signed in to change notification settings - Fork 7
/
webpack.config.js
56 lines (54 loc) · 1.55 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
'use strict';
const autoprefixer = require('autoprefixer');
const cssnano = require('cssnano');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const path = require('path');
const webpack = require('webpack');
module.exports = {
context: path.join(__dirname, 'bundles'),
entry: {
main: './main/main.js',
quests: './quests/quests.js',
profile: './profile/profile.js',
questPage: './quest_page/quest_page.js',
questAddition: './questAddition/questAddition.js'
},
devtool: 'source-map',
output: {
path: path.join(__dirname, 'public'),
filename: '[name].js',
sourceMapFilename: '[name].map',
publicPath: '/'
},
module: {
loaders: [
{
test: /\.css$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader')
},
{
test: /(\.png$)|(\.jpg$)|(\.jpeg$)/,
loader: 'file-loader'
},
{
test: /\.js$/,
loader: 'babel',
exclude: /node_modules/
},
{
test: /\.hbs$/,
loader: 'handlebars-loader',
query: {
partialDirs: [
path.join(__dirname, 'blocks')
]
}
}
]
},
plugins: [
new ExtractTextPlugin('[name].css'),
new webpack.optimize.UglifyJsPlugin()
],
postcss: () => [autoprefixer, cssnano]
};