-
Notifications
You must be signed in to change notification settings - Fork 44
/
webpack.config.js
62 lines (60 loc) · 1.37 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
/**
* Created by Vadym Yatsyuk on 25.02.18
*/
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
var config = {
entry: [
// 'webpack-dev-server/client?http://0.0.0.0:9000',
// 'webpack/hot/only-dev-server',
'./src/app.ts',
],
output: {
filename: 'bundle.js',
path: __dirname,
},
devServer: {
static: {
directory: __dirname,
},
host: process.env.HOST || 'localhost',
port: process.env.PORT || 9000,
open: true, // open page in browser
},
module: {
rules: [
// commented for now due to issue with webpack 4
// {
// test: /\.tsx?$/,
// enforce: 'pre',
// loader: 'tslint-loader',
// options: {
// configFile: 'tslint.json'
// }
// },
{
test: /\.scss$/,
use: [
'style-loader', // creates style nodes from JS strings
'css-loader', // translates CSS into CommonJS
'sass-loader', // compiles Sass to CSS, using Node Sass by default
],
},
{
test: /\.tsx?$/,
loader: 'ts-loader',
exclude: /node_modules/,
},
],
},
plugins: [
// new HtmlWebpackPlugin({
// template: './index.html'
// })
],
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
};
module.exports = config;