Changeset View
Changeset View
Standalone View
Standalone View
lib/webpack/shared.cjs
Show First 20 Lines • Show All 245 Lines • ▼ Show 20 Lines | plugins: [ | ||||
COMM_ALCHEMY_KEY: JSON.stringify(alchemyKey), | COMM_ALCHEMY_KEY: JSON.stringify(alchemyKey), | ||||
COMM_WALLETCONNECT_KEY: JSON.stringify(walletConnectKey), | COMM_WALLETCONNECT_KEY: JSON.stringify(walletConnectKey), | ||||
}, | }, | ||||
}), | }), | ||||
], | ], | ||||
}; | }; | ||||
} | } | ||||
function createWebWorkersConfig(env, baseConfig, babelConfig) { | |||||
return { | |||||
...baseConfig, | |||||
name: 'webworkers', | |||||
target: 'webworker', | |||||
mode: env.prod ? 'production' : 'development', | |||||
module: { | |||||
rules: [getBrowserBabelRule(babelConfig)], | |||||
}, | |||||
plugins: [ | |||||
...sharedPlugins, | |||||
new webpack.DefinePlugin({ | |||||
'process.env': { | |||||
NODE_ENV: JSON.stringify(env.prod ? 'production' : 'development'), | |||||
BROWSER: true, | |||||
}, | |||||
}), | |||||
], | |||||
}; | |||||
} | |||||
module.exports = { | module.exports = { | ||||
createProdBrowserConfig, | createProdBrowserConfig, | ||||
createDevBrowserConfig, | createDevBrowserConfig, | ||||
createNodeServerRenderingConfig, | createNodeServerRenderingConfig, | ||||
createWebWorkersConfig, | |||||
}; | }; |