This repository has been archived by the owner on Aug 3, 2024. It is now read-only.
forked from strimbles/VoteWise
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
108 lines (105 loc) · 3.54 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
'use strict';
var path = require('path');
var webpack = require('webpack');
var helper = require('./gulp_tasks/common/helper');
module.exports = {
cache: true,
context: path.join(__dirname, 'client/scripts'),
output: {
// devtoolModuleFilenameTemplate: function(info) {
// //console.log(module);
// return 'scripts/' + info.resourcePath.replace(__dirname, '../..').replace('/~/', '/node_modules/');
// },
devtoolModuleFilenameTemplate: 'scripts/[resource-path]',
devtoolFallbackModuleFilenameTemplate: '[absolute-resource-path]?[hash]'
},
stats: {
colors: true,
reasons: true
},
resolve: {
alias: {
'ionic': 'ionic-sdk/release/js/ionic.js',
'ionic-angular': 'ionic-sdk/release/js/ionic-angular.js',
'unitHelper': './test/unit/unitHelper.js',
'lbServices': './client/scripts/lbServices.js'
},
root: [
path.resolve(path.join(__dirname, 'node_modules')),
path.resolve(path.join(__dirname, 'bower_components'))
],
modulesDirectories: ['node_modules', 'bower_components']
},
module: {
loaders: [{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
cacheable: true,
loader: 'babel-loader',
query: {
stage: 0,
optional: ['runtime', 'es7.asyncFunctions'],
//retainLines: true,
cacheDirectory: true
}
}, {
test: /\.js$/,
loader: 'transform/cacheable?brfs!transform/cacheable?envify',
exclude: /(node_modules|bower_components)/,
cacheable: true
}, {
test: /\.css$/,
loader: 'style!css',
cacheable: true
//exclude: /(node_modules|bower_components)/
}, {
test: /\.scss$/,
loader: 'style!css!sass?sourceMap',
cacheable: true,
exclude: /(node_modules|bower_components)/
}, {
test: /\.sass$/,
// Passing indentedSyntax query param to node-sass
loader: 'style!css!sass?indentedSyntax&sourceMap',
cacheable: true,
exclude: /(node_modules|bower_components)/
}, {
test: /\.less$/,
loader: 'style!css!less?strictMath&noIeCompat',
cacheable: true,
exclude: /(node_modules|bower_components)/
}, {
test: /\.html$/,
cacheable: true,
loader: 'html'
}, {
test: /\.json$/,
cacheable: true,
loader: 'json'
}, {
test: /\.woff/,
loader: 'url?prefix=font/&limit=10000&mimetype=application/font-woff'
}, {
test: /\.ttf/,
loader: 'file?prefix=font/'
}, {
test: /\.eot/,
loader: 'file?prefix=font/'
}, {
test: /\.svg/,
loader: 'file?prefix=font/'
}]
},
plugins: [
new webpack.ResolverPlugin([
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin('package.json', ['main']),
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin('bower.json', ['main'])
]),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.AggressiveMergingPlugin(),
new webpack.BannerPlugin(helper.getBanner(), {
raw: true
})
]
};