-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
66 lines (65 loc) · 2.01 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
var path = require('path');
var webpack = require("webpack");
var ExtractTextPlugin = require("extract-text-webpack-plugin");
const FONT_OPTS = 'name=fonts/[name].[ext]&outputPath=dist/&publicPath=../';
module.exports = {
entry: {
"vendor": __dirname + "/app/vendor",
"app": __dirname + "/app/main",
"openapi": __dirname + "/app/openapi",
},
output: {
path: __dirname + '/docs',
filename: "dist/[name].bundle.js",
},
resolve: {
extensions: ['.js', '.ts']
},
module: {
loaders: [{
test: /\.html$/,
loader: 'file-loader?name=[name].[ext]!extract-loader!html-loader?interpolate=true',
}, {
test: /\.ts$/,
loaders: ['ts-loader'],
}, {
test: /\.js$/,
loader: 'babel-loader?presets[]=es2015',
}, {
test: /\.json$/,
loader: 'json-loader',
}, {
test: /\.pug$/,
loader: ['raw-loader', 'pug-html-loader?doctype=html&plugins=pug-plugin-ng'],
}, {
test: /\.css$/,
loader: ExtractTextPlugin.extract({fallbackLoader: "style-loader", loader: "css-loader"}),
}, {
test: /\.scss$/,
loaders: ['style-loader', 'css-loader', 'sass-loader'],
}, {
test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url-loader?limit=10000&mimetype=application/font-woff&' + FONT_OPTS
}, {
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url-loader?limit=10000&mimetype=application/octet-stream&' + FONT_OPTS
}, {
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
loader: 'file-loader?' + FONT_OPTS
}, {
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url-loader?limit=10000&mimetype=image/svg+xml&' + FONT_OPTS
}, {
test: /\.png(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url-loader?limit=10000&mimetype=image/svg+xml&' + FONT_OPTS
}]
},
plugins: [
new webpack.LoaderOptionsPlugin({
minimize: true,
debug: false,
}),
new ExtractTextPlugin("dist/[name].css"),
new webpack.optimize.CommonsChunkPlugin({name: "vendor", filename: "dist/vendor.bundle.js"}),
]
}