MCPcopy Create free account
hub / github.com/violentmonkey/violentmonkey / buildConfig

Function buildConfig

scripts/webpack.conf.js:58–71  ·  view source on GitHub ↗
(page, entry, init)

Source from the content-addressed store, hash-verified

56 if (window[INIT_FUNC_NAME] !== 1)`;
57
58const buildConfig = (page, entry, init) => {
59 const config = entry ? getBaseConfig() : getPageConfig();
60 config.plugins.push(new webpack.DefinePlugin({
61 ...defsObj,
62 // Conditional compilation to remove unsafe and unused stuff from `injected`
63 'process.env.IS_INJECTED': JSON.stringify(/injected/.test(page) && page),
64 }));
65 if (typeof entry === 'string') {
66 config.entry = { [page]: entry };
67 }
68 if (!entry) init = page;
69 if (init) init(config);
70 return config;
71};
72
73module.exports = [
74 buildConfig((config) => {

Callers 1

webpack.conf.jsFile · 0.85

Calls 4

getBaseConfigFunction · 0.85
getPageConfigFunction · 0.85
initFunction · 0.50
testMethod · 0.45

Tested by

no test coverage detected