forked from Mike5535/2022_2_BugOverload_UI_kit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
54 lines (52 loc) · 1.45 KB
/
Copy pathwebpack.config.js
File metadata and controls
54 lines (52 loc) · 1.45 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
50
51
52
53
54
const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const packageConfig = require('./package.json');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
module.exports = {
mode: "development",
entry: './src/index.ts',
output: {
path: path.resolve(__dirname, 'dist'),
publicPath: '/',
filename: 'index.js',
library: packageConfig.name,
libraryTarget: 'umd',
clean: true,
},
resolve: {
extensions: ['.js', '.json', '.ts'],
plugins: [new TsconfigPathsPlugin()],
},
module: {
rules: [
{
test: /\.(scss|css)$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
},
{
test: /\.handlebars$/,
use: ['handlebars-loader'],
exclude: /node_modules/,
},
{
test: /\.ts$/,
exclude: path.resolve(__dirname, './node_modules'),
use: ['babel-loader', 'ts-loader'],
},
{
test: /\.(jpg|jpeg|png|svg|ico|webp)$/,
type: 'asset/resource',
},
{
test: /\.(ttf|eot|woff|woff2)$/,
type: 'asset/resource',
},
],
},
plugins: [
new CleanWebpackPlugin(),
],
optimization: {
minimize: true,
},
}