-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
42 lines (41 loc) · 1.27 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
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: {
main: ['./src/main.ts']
},
output: {
filename: '[name].js',
publicPath: '/',
path: path.resolve(__dirname, 'build')
},
module: {
rules: [
{ test: /\.html$/, use: [{ loader: 'html-loader' }] },
{ test: /\.tsx?$/, use: [{ loader: 'awesome-typescript-loader' }] },
{
test: /\.scss$/, use: ExtractTextPlugin.extract({
use: [
{ loader: 'css-loader', options: { sourceMap: true } },
{ loader: 'sass-loader', options: { sourceMap: true } }
]
})
},
{ test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/, use: 'file-loader' }
]
},
resolve: {
extensions: ['.ts', '.js']
},
plugins: [
new ExtractTextPlugin('styles.css'),
new HtmlWebpackPlugin({
hash: true,
filename: 'index.html',
template: __dirname + '/src/index.html',
})
],
devtool: 'source-map'
};