-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.build-demo.config.js
52 lines (49 loc) · 1.18 KB
/
webpack.build-demo.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import path from 'path';
import HtmlWebPackPlugin from 'html-webpack-plugin';
import { fileURLToPath } from 'node:url'
const filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(filename)
const config = {
devtool: 'source-map',
mode: 'production',
entry: path.resolve(dirname, 'demo/index.tsx'),
output: {
filename: 'demo.bundle.js',
path: path.resolve(dirname, 'dist-demo'),
},
module: {
rules: [
{
test: /\.(js|jsx|ts|tsx)$/,
exclude: /node_modules/,
use: [{
loader: 'ts-loader',
options: {
configFile: 'tsconfig.json',
compilerOptions: {
outDir: "./dist-demo",
declarationDir: undefined,
declaration: false
},
},
}],
},
],
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx'],
alias: {
'@faceless-ui/slider': path.resolve(dirname, 'src/index.ts'),
},
extensionAlias: {
'.js': ['.ts', '.js', '.tsx', '.jsx'],
'.mjs': ['.mts', '.mjs'],
},
},
plugins: [
new HtmlWebPackPlugin({
template: 'demo/index.html',
}),
],
};
export default config;