-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathwebpack.modules.js
More file actions
41 lines (38 loc) · 771 Bytes
/
webpack.modules.js
File metadata and controls
41 lines (38 loc) · 771 Bytes
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
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const DEMO_DIR = path.resolve(__dirname, 'demo/modules')
const config = {
mode: 'development',
entry: './demo/modules/script.js',
output: {
path: path.resolve(__dirname, 'demo/dist'),
filename: 'demo.js',
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.js'],
},
devServer: {
static: {
directory: DEMO_DIR,
},
compress: false,
port: 8080
},
plugins: [
new HtmlWebpackPlugin({
template: `${DEMO_DIR}/index.html`,
filename: 'index.html',
inject: 'body',
}),
]
}
module.exports = config