-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
55 lines (54 loc) · 1.43 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
/***
* Excerpted from "Node.js 8 the Right Way",
* published by The Pragmatic Bookshelf.
* Copyrights apply to this code. It may not be used to create training material,
* courses, books, articles, and the like. Contact us if you are in doubt.
* We make no guarantees that this code is fit for any purpose.
* Visit http://www.pragmaticprogrammer.com/titles/jwnode2 for more book information.
***/
'use strict';
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: './app/index.ts',
output: {
filename: 'bundle.js',
path: path.join(__dirname, 'dist'),
},
module: {
rules: [{
enforce: 'pre',
test: /\.js$/,
use: ['source-map-loader'],
},{
enforce: 'pre',
test: /\.ts$/,
use: ['source-map-loader'],
},{
test: /\.ts$/,
loader: 'ts-loader',
},{
test: /\.css$/,
use: ExtractTextPlugin.extract({
use: 'css-loader',
fallback: 'style-loader',
}),
},{
test: /\.(png|woff|woff2|eot|ttf|svg)$/,
loader: 'url-loader?limit=100000',
}]
},
devtool: 'source-map',
plugins: [
new ExtractTextPlugin('styles.css'),
new HtmlWebpackPlugin({
title: 'Customers Tracker',
}),
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery'
}),
],
};