-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathwebpack.config.ts
47 lines (44 loc) · 944 Bytes
/
webpack.config.ts
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
import * as path from 'path';
import htmlWebpackPlugin from 'html-webpack-plugin';
import { CleanWebpackPlugin } from 'clean-webpack-plugin';
export default {
entry: './src/index.ts',
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'lib'),
},
resolve: {
extensions: ['.ts', '.js'],
},
module: {
rules: [
{
test: /\.(ts|js)?$/,
use: 'babel-loader',
exclude: /node_modules/,
},
{
test: /.html?$/,
use: 'html-loader',
},
{
test: /.ejs?$/,
use: 'ejs-loader',
}
],
},
devServer: {
contentBase: './lib',
hot: true,
port: 3000,
open: true,
},
plugins: [
new htmlWebpackPlugin({
title: 'ts插件库测试',
template: './assets/template/index.ejs',
}),
new CleanWebpackPlugin(),
],
devtool: 'inline-source-map',
};