This repository was archived by the owner on May 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathwebpack.config.js
More file actions
58 lines (55 loc) · 1.46 KB
/
webpack.config.js
File metadata and controls
58 lines (55 loc) · 1.46 KB
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
const webpack = require("webpack");
const CopyWebpackPlugin = require('copy-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
var path = require('path');
module.exports = {
entry : {
'homepage': "./src/homepage.js",
'app': "./src/main.browser.ts"
},
output : {
filename : '[name].js',
path : path.resolve(__dirname, 'src/generated/resources/static/app'),
},
resolve: {
extensions: ['.ts', '.js']
},
module : {
loaders : [{
test: /\.ts$/,
loader: 'awesome-typescript-loader'
}, {
test : /\.css$/,
loader : 'style-loader!css-loader'
}, {
test : /\.(jpg|gif)$/,
loader : 'url-loader?limit=8192'
}, {
test : /\.(png)$/,
loader : 'file-loader'
}, {
test : /\.(ttf|eot|svg|woff(2)?)(\?[a-z0-9=&.]+)?$/,
loader : 'file-loader'
} ]
},
plugins : [
new webpack.ProvidePlugin({
$ : "jquery",
jQuery : "jquery" }),
new HtmlWebpackPlugin({
template: './src/index.html',
favicon : 'src/app/img/favicon.png'}),
new webpack.ContextReplacementPlugin(
// The (\\|\/) piece accounts for path separators in *nix and Windows
/angular(\\|\/)core(\\|\/)@angular/,
root('./src'), // location of your src
{}),
// new CopyWebpackPlugin([ {
// from : 'src/app/assets',
// to : 'assets'}]
// )
]
}
function root(__path) {
return path.join(__dirname, __path);
}