-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
38 lines (37 loc) · 1.16 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
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const { ContextReplacementPlugin } = require('webpack');
module.exports = {
entry: {
main: './src/main.ts'
},
output: {
path: path.join(__dirname, "dist/"),
filename: "[name].bundle.js"
},
resolve: {
extensions: ['.js', '.ts', '.html', '.scss']
},
module: {
loaders: [
{ test: /\.ts$/, use: [ 'awesome-typescript-loader', 'angular2-template-loader' ] },
{ test: /\.html$/, use: 'raw-loader' },
{ test: /\.scss$/, use: [ 'raw-loader', 'sass-loader' ] },
{ test: /\.(png|jpg|svg)$/, use: 'file-loader' }
]
},
plugins: [
new HtmlWebpackPlugin({
template: "./src/index.html",
filename: "index.html",
showErrors: true,
title: "Webpack App",
path: path.join(__dirname, "dist/"),
hash: true
}),
new ContextReplacementPlugin(
/angular(\\|\/)core(\\|\/)@angular/,
path.resolve(__dirname, 'src')
)
]
}