-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.partial.ts
More file actions
56 lines (52 loc) · 1.31 KB
/
Copy pathwebpack.partial.ts
File metadata and controls
56 lines (52 loc) · 1.31 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
55
56
const {
DefinePlugin ,
ProvidePlugin ,
} = webpack;
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const obsCurrentPkg = path.join(absProjectRootDir , 'packages/refaxels/packages/i18n');
export default {/*will be dynamic imported*/
entry : path.join(__dirname , 'src/index') ,
output : {
path : path.join(__dirname , 'dist') ,
filename : 'esm/index.js' ,
} ,
devtool : 'source-map' ,
resolve : {
alias : {
"mobx-vue" : path.join(absProjectRootDir , "libs/mobx-vue-lite") ,
},
} ,
// stats : 'errors-only' ,
externals : [
"reaxes" ,
'reaxes-utils' ,
"reaxes-toolkit" ,
"vue" ,
'lodash' ,
'mobx' ,
'reaxel-persist'
] ,
mode : 'production' ,
performance : {
maxEntrypointSize : 10000000 ,
maxAssetSize : 30000000 ,
} ,
plugins : [
new CleanWebpackPlugin() ,
new CopyWebpackPlugin({
patterns : [
{
from : path.join(obsCurrentPkg , 'publish/') ,
to : path.join(obsCurrentPkg , 'dist/') ,
} ,
] ,
}) ,
] ,
} as Configuration;
import webpack , { Configuration } from 'webpack';
import { absProjectRootDir } from '../../build-tools/toolkit';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import { CleanWebpackPlugin } from 'clean-webpack-plugin';
import path from "node:path";
import { fileURLToPath } from 'url';