File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
configs/webpack-config-compass/src Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,17 @@ export function createElectronMainConfig(
147147 sharedObjectLoader ( opts ) ,
148148 sourceLoader ( opts ) ,
149149 ] ,
150+ parser : {
151+ javascript : {
152+ // Webpack compile time check for imports matching exports is too strict
153+ // in cases where the code expects some name export to be optional
154+ // (webpack will break the build if it fails to statically see the
155+ // matching export) this is why we switch the check to just warn. If
156+ // this ever hides a real case where a missing import is being used, it
157+ // will definitely break in runtime anyway
158+ importExportsPresence : 'warn' as const ,
159+ } ,
160+ } ,
150161 } ,
151162 node : false as const ,
152163 externals : toCommonJsExternal ( sharedExternals ) ,
@@ -218,6 +229,11 @@ export function createElectronRendererConfig(
218229 sharedObjectLoader ( opts ) ,
219230 sourceLoader ( opts ) ,
220231 ] ,
232+ parser : {
233+ javascript : {
234+ importExportsPresence : 'warn' as const ,
235+ } ,
236+ } ,
221237 } ,
222238 plugins : [
223239 ...entriesToHtml ( entries ) ,
@@ -338,6 +354,11 @@ export function createWebConfig(args: Partial<ConfigArgs>): WebpackConfig {
338354 assetsLoader ( opts ) ,
339355 sourceLoader ( opts ) ,
340356 ] ,
357+ parser : {
358+ javascript : {
359+ importExportsPresence : 'warn' as const ,
360+ } ,
361+ } ,
341362 } ,
342363 // This follows current Compass plugin behavior and is here more or less to
343364 // keep compat for the external plugin users
You can’t perform that action at this time.
0 commit comments