-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
35 lines (34 loc) · 991 Bytes
/
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
const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
devtool: 'source-map',
entry: './src/index.ts',
output: {
path: path.resolve(__dirname, 'docs'),
filename: 'index.bundle.js'
},
module: {
rules: [
{ test: /\.tsx?$/, use: 'ts-loader', exclude: /node_modules/ },
{ test: /\.css$/, sideEffects: true, use: ["style-loader", "css-loader"] }
]
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
devServer: {
static: {
directory: path.join(__dirname),
},
port: 9000
},
plugins: [
new CopyWebpackPlugin({
patterns: [
{ from: './index.html', to: 'index.html' },
{ from: './index.css', to: 'index.css' },
{ from: path.resolve(__dirname, './assets'), to: path.resolve(__dirname, './docs/assets') }
]
})
]
}