MCPcopy Create free account
hub / github.com/decaporg/decap-cms / plugins

Function plugins

scripts/webpack.js:56–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54}
55
56function plugins() {
57 return {
58 ignoreEsprima: () => new webpack.IgnorePlugin({ resourceRegExp: /^esprima$/ }),
59 friendlyErrors: () => new FriendlyErrorsWebpackPlugin(),
60 buffer: () =>
61 new webpack.ProvidePlugin({
62 Buffer: ['buffer', 'Buffer'],
63 process: 'process/browser',
64 }),
65 nodePolyfill: () => new NodePolyfillPlugin(),
66 stripNodeProtocol: () =>
67 new webpack.NormalModuleReplacementPlugin(/^node:/, resource => {
68 const moduleName = resource.request.replace(/^node:/, '');
69 // Handle node:url specially to provide fileURLToPath polyfill
70 if (moduleName === 'url') {
71 resource.request = path.resolve(__dirname, 'shims/fileURLToPath.js');
72 } else {
73 resource.request = moduleName;
74 }
75 }),
76 };
77}
78
79function stats() {
80 if (isProduction) {

Callers 2

baseConfigFunction · 0.70
webpack.jsFile · 0.70

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected