-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.partial.ts
More file actions
40 lines (38 loc) · 920 Bytes
/
Copy pathwebpack.partial.ts
File metadata and controls
40 lines (38 loc) · 920 Bytes
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
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
/*will be dynamic imported*/
export default {
entry : {
index : path.join(__dirname , 'src/index') ,
hooks : path.join(__dirname , 'src/hooks/index') ,
},
output : {
path : path.join(__dirname , 'dist') ,
filename : 'esm/[name].js' ,
} ,
externals : [
'reaxes' ,
'reaxes-utils' ,
'reaxes-toolkit' ,
'react' ,
'react-dom' ,
'lodash' ,
'mobx' ,
] ,
plugins : [
new CleanWebpackPlugin() ,
new CopyWebpackPlugin({
patterns : [
{
from : path.join(__dirname , 'publish/') ,
to : path.join(__dirname , 'dist/') ,
} ,
] ,
}) ,
] ,
} as Configuration;
import path from "node:path";
import { fileURLToPath } from 'url';
import { Configuration } from 'webpack';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import { CleanWebpackPlugin } from 'clean-webpack-plugin';