-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
54 lines (54 loc) · 1.5 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
"use strict";
const webpack = require("webpack"),
path = require("path"),
HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = {
entry: {
"vendor": "./src/vendor",
"app": "./src/boot"
},
output: {
path: __dirname + '/dist',
filename: "js/[name].bundle.js"
},
resolve: {
extensions: ['.js', '.ts']
},
devtool: 'source-map',
module: {
rules: [
{enforce: 'pre', test: /\.ts?$/, loader: 'tslint-loader', exclude: /(node_modules|libs)/},
{
test: /\.ts/,
loader: 'ts-loader',
exclude: /node_modules/
},
{test:/\.html$/, loader:'html-loader' },
{
test: /\.scss$/,
loaders: ["style-loader", "css-loader", "sass-loader"]
},
{ test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "url-loader?limit=10000&minetype=application/font-woff" },
{ test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file-loader" }
]
},
plugins: [
new webpack.ContextReplacementPlugin(
/angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
__dirname
),
new HtmlWebpackPlugin({
title: 'Angular 2 test app',
template: 'src/template-index.ejs', // Load a custom template
inject: 'body'
}),
new webpack.optimize.CommonsChunkPlugin({ name: "vendor", filename: "js/vendor.bundle.js"})
],
devServer: {
contentBase: path.join(__dirname, "dist"),
historyApiFallback: true,
publicPath: '/',
inline: true,
port: 7000
}
};