-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.dev.js
More file actions
executable file
·85 lines (83 loc) · 2.43 KB
/
webpack.dev.js
File metadata and controls
executable file
·85 lines (83 loc) · 2.43 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry: './src/index.tsx',
devtool: 'inline-source-map',
resolve: {
alias: {
app: path.resolve(__dirname, './src'),
components: path.resolve(__dirname, './src/components'),
routes: path.resolve(__dirname, './src/routes'),
},
extensions: ['.tsx', '.ts', '.js', '.css']
},
module: {
rules: [
{
test: /\.tsx?$/,
enforce: 'pre',
loader: 'tslint-loader',
exclude: [
/node_modules/,
/\.prod\.tsx?$/
],
options: {
emitErrors: true,
}
},
{
test: /\.tsx?$/,
loader: 'ts-loader',
exclude: [
/node_modules/,
/\.prod\.tsx?$/
],
options: {
configFile: 'tsconfig.json',
}
},
{
// Needed to load CSS files from packages. EG. leaflet.css
test: /\.css$/,
use: [
{ loader: 'style-loader' },
{ loader: 'css-loader' },
{ loader: 'resolve-url-loader' },
]
},
{
test: /\.scss$/,
exclude: /node_modules/,
use: ExtractTextPlugin.extract({
use: [
{ loader: "css-loader" },
{
loader: "sass-loader",
options: {
sourceMap: true,
}
},
],
fallback: "style-loader",
}),
},
]
},
output: {
filename: 'static/js/bundle.js',
path: path.resolve(__dirname, 'dist'),
publicPath: '/'
},
devServer: {
contentBase: path.resolve(__dirname, 'dist'),
port: 8080,
historyApiFallback: true,
},
plugins: [
new ExtractTextPlugin('bundle.css'),
new HtmlWebpackPlugin({
template: "index.html"
})
]
};