Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return callback();
}
let fileExtension = entry.split('.');
fileExtension = `.${fileExtension[fileExtension.length - 1]}`;
const FILE_SUPPORT_REGEXP = /.(js|jsx)$/g;
if (!FILE_SUPPORT_REGEXP.test(fileExtension)) {
compilation.errors.push(
prettyError.fileExtension(entry, compiler.context),
);
return callback();
}
try {
result = requirefresh(entry);
} catch (error) {
compilation.errors.push(prettyError.errorWrapper(error));
return callback();
}
compilation.fileDependencies.add(entry);
if (result.default && typeof result.default === 'object') {
result = result.default;
}
Object.keys(result).forEach((key) => {
let renderedStaticMarkup = '';
try {
renderedStaticMarkup = `${renderToStaticMarkup(
(function() {
var CSON, ambi, coffee, extractOpts, fsUtil, isJsOrCoffee, isJsonOrCson, js2coffee, pathUtil, requireFreshSafe, wait;
coffee = require('coffee-script');
js2coffee = require('js2coffee');
fsUtil = require('fs');
pathUtil = require('path');
ambi = require('ambi');
extractOpts = require('extract-opts').extractOpts;
requireFreshSafe = require('requirefresh').requireFreshSafe;
require('coffee-script/register');
wait = function(delay, fn) {
return setTimeout(fn, delay);
};
isJsOrCoffee = function(filePath) {
return /\.(js|coffee)$/.test(filePath);
};
isJsonOrCson = function(filePath) {
return /\.(json|cson)$/.test(filePath);
};
CSON = {