forked from BioPhoton/angular1-star-rating
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
81 lines (66 loc) · 2.19 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
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('./node_modules/html-webpack-plugin');
var nodeExternals = require('webpack-node-externals');
var base_c = require('./chore/chore.config');
module.exports = function makeWebpackConfig() {
/**
* Config
* Reference: http://webpack.github.io/docs/configuration.html
* This is the object where all configuration gets set
*/
var config = {};
config.resolve = {
// Add `.ts` and `.tsx` as a resolvable extension.
extensions: ['', '.html', '.scss', '.ts', '.tsx', '.js', '.webpack.js', '.web.js']
, root: __dirname
};
//Exclude all external files from bundle
config.externals = {
'angular' : 'angular'
};
config.entry = {
app: path.join(__dirname, base_c.src, 'index.ts')
};
config.output = {
filename: "index.js"
, path: path.join(__dirname, base_c.dist)
};
//config.output.libraryTarget = "amd";
//config.output.filename = "[name].js";
// Source maps support
config.devtool = 'source-map';
config.module = {
/*preLoaders: [
{
test: /\.ts$/,
loader: 'baggage?[file].html&[file].css'
}
],*/
loaders: [
{test: /\.css$/, loader: "style!css"}
, {test: /\.scss$/, loader: "style!css!sass"}
// specify option using query
, {test: /\.tsx?$/, exculde: "*.jasmine.ts", loader: 'ts-loader?compiler=ntypescript'}
, {test: /\.html$/, loader: 'ngtemplate?relativeTo=' + __dirname + '/!html'}
, {
test: [/\.svg/],
loader: 'file?name=assets/images/[name].[ext]'
}
//inline base64 URLs for <=8k images, direct URLs for the rest
//, {test: /\.(svg|png|jpg)$/, loader: 'url-loader?limit=8192'}
]
};
config.sassLoader = {
outputStyle: 'compressed'
};
config.plugins = [
new webpack.optimize.DedupePlugin()
, new webpack.optimize.UglifyJsPlugin({
compress: {warnings: false}
, comments: false
})
/**/
];
return config;
}();