MCPcopy
hub / github.com/toeverything/AFFiNE / getWebpackBundleConfigs

Function getWebpackBundleConfigs

tools/cli/src/bundle.ts:87–157  ·  view source on GitHub ↗
(pkg: Package)

Source from the content-addressed store, hash-verified

85}
86
87function getWebpackBundleConfigs(pkg: Package): webpack.MultiConfiguration {
88 switch (pkg.name) {
89 case '@affine/admin': {
90 return [
91 createWebpackHTMLTargetConfig(
92 pkg,
93 pkg.srcPath.join('index.tsx').value,
94 { selfhostPublicPath: '/admin/' }
95 ),
96 ] as webpack.MultiConfiguration;
97 }
98 case '@affine/web':
99 case '@affine/mobile':
100 case '@affine/ios':
101 case '@affine/android': {
102 const workerConfigs = getBaseWorkerConfigs(
103 pkg,
104 createWebpackWorkerTargetConfig
105 );
106 workerConfigs.push(
107 createWebpackWorkerTargetConfig(
108 pkg,
109 pkg.srcPath.join('nbstore.worker.ts').value
110 )
111 );
112
113 return [
114 createWebpackHTMLTargetConfig(
115 pkg,
116 pkg.srcPath.join('index.tsx').value,
117 {},
118 workerConfigs.map(config => config.name)
119 ),
120 ...workerConfigs,
121 ] as webpack.MultiConfiguration;
122 }
123 case '@affine/electron-renderer': {
124 const workerConfigs = getBaseWorkerConfigs(
125 pkg,
126 createWebpackWorkerTargetConfig
127 );
128
129 return [
130 createWebpackHTMLTargetConfig(
131 pkg,
132 {
133 index: pkg.srcPath.join('app/index.tsx').value,
134 shell: pkg.srcPath.join('shell/index.tsx').value,
135 popup: pkg.srcPath.join('popup/index.tsx').value,
136 backgroundWorker: pkg.srcPath.join('background-worker/index.ts')
137 .value,
138 },
139 {
140 additionalEntryForSelfhost: false,
141 injectGlobalErrorHandler: false,
142 emitAssetsManifest: false,
143 },
144 workerConfigs.map(config => config.name)

Callers 2

buildWithWebpackMethod · 0.85
devWithWebpackMethod · 0.85

Calls 4

getBaseWorkerConfigsFunction · 0.85
mapMethod · 0.80
pushMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected