-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwebpack.config.js
More file actions
49 lines (49 loc) · 1.14 KB
/
Copy pathwebpack.config.js
File metadata and controls
49 lines (49 loc) · 1.14 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
const webpack = require('webpack');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextWebpackPlugin = require('extract-text-webpack-plugin');
module.exports = {
mode: 'none',
// entry: './client/index',
entry: './src/class-work',
output: {
filename: "[name].bundle.js",
chunkFilename: '[name].bundle.js',
path: path.resolve(__dirname,'dist')
},
devtool: "source-map",
resolve: {
extensions: [".ts", ".tsx", ".js", ".json"]
},
module: {
rules: [
{ test: /\.tsx?$/, loader: "ts-loader", exclude: ["node_modules"] },
{
test: /\.css/,
loader: ExtractTextWebpackPlugin.extract({
fallback: "style-loader",
use: "css-loader"
})
}
]
},
optimization: {
splitChunks: {
cacheGroups: {
vendor: {
chunks: 'initial',
name: 'vendor',
test: 'vendor',
enforce: true
},
}
},
runtimeChunk: true
},
plugins: [
new HtmlWebpackPlugin({
template: "./client/index.html"
}),
new ExtractTextWebpackPlugin('styles.css')
]
};