-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.common.config.js
37 lines (36 loc) · 1009 Bytes
/
webpack.common.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
const InjectPlugin = require('webpack-inject-plugin').default;
module.exports = () => {
return {
entry: './src/index.ts',
output: {
filename: 'dist/main.bundle.js',
chunkFilename: 'dist/[name].js',
path: __dirname,
publicPath: "/"
},
resolve: {
extensions: ['.ts', '.js']
},
module: {
rules: [
{
test: /\.tsx?$/,
exclude: /node_modules/,
use: 'ts-loader'
},
{
test: /\.css$/,
use: ['to-string-loader', 'css-loader'],
},
{
test: /\.(png|jpg|svg|jpeg|gif)$/,
loader: 'url-loader'
},
{
test: /\.pug$/,
loader: ['raw-loader', 'pug-html-loader']
}
]
}
}
};