forked from lugia-ysstech/lugia-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlugia.config.js
74 lines (70 loc) · 1.53 KB
/
lugia.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import { join, } from 'path';
import megaDesktopConfig from './config/mega.desktop.config.json';
export default {
disableCSSModules: true,
cssModulesWithAffix: true,
entry: './portal/index.js',
publicPath: '/',
alias: {
'@': join(__dirname, './src'),
},
dllDependenciesExcludes: [],
extraBabelIncludes: [/decamelize/,],
extraBabelPlugins: [
[
'import',
{
libraryName: '@lugia/lugia-web',
libraryDirectory: 'dist',
},
'@lugia/lugia-web',
],
[
'import',
{
libraryName: '@/components',
libraryDirectory: '',
camel2DashComponentName: false,
},
'@/components',
],
],
applyWebpack(webpackConfig, { webpack, merge, }) {
return webpackConfig;
},
generator(api) {
const {
appPath,
pkg: { version, },
} = api.getApp();
const verbose = api.isVerbose();
const { fs, mergeObj, } = api._utils();
fs.writeJSONSync(
join(appPath, './config/mega.desktop.config.json'),
mergeObj(megaDesktopConfig, {
extraMega: {
engines: {
scaffolding: { version, },
},
},
}),
{
spaces: 2,
}
);
if (verbose) {
console.log(
`update scaffolding(${megaDesktopConfig.extraMega.engines.scaffolding.name}) version: ${version}`
);
}
api.mergePackage(pkg => {
delete pkg.files;
return {
...pkg,
version: '1.0.0',
private: true,
};
});
},
...megaDesktopConfig,
};