Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.apply = function(compiler) {
if (!hopsConfig.workerFile) {
return;
}
function onMake(compilation, callback) {
compilation
.createChildCompiler(PLUGIN_NAME, { filename: assetPath }, [
new SingleEntryPlugin(
compiler.context,
require.resolve('../shims/worker-shim'),
'worker'
),
])
.runAsChild(callback);
}
function onEmit(compilation, callback) {
module.exports = function getResolveConfig(target) {
var platform = target === 'node' ? 'server' : 'browser';
return {
alias: Object.assign(
{
'hops-entry-point': hopsConfig.appDir,
},
hopsConfig.workerFile && {
'hops-worker-entry-point': hopsConfig.workerFile,
}
),
mainFields: [
'esnext:' + platform,
'jsnext:' + platform,
platform,
'esnext',
'jsnext',
'esnext:main',
'jsnext:main',
'main',
],
modules: ['node_modules'].concat(hopsConfig.moduleDirs),
extensions: ['.js', '.jsx'],
};
};
module.exports = function getResolveConfig(target) {
var platform = target === 'node' ? 'server' : 'browser';
return {
alias: Object.assign(
{
'hops-entry-point': hopsConfig.appDir,
},
hopsConfig.workerFile && {
'hops-worker-entry-point': hopsConfig.workerFile,
}
),
mainFields: [
'esnext:' + platform,
'jsnext:' + platform,
platform,
'esnext',
'jsnext',
'esnext:main',
'jsnext:main',
'main',
],
modules: ['node_modules'].concat(hopsConfig.moduleDirs),
extensions: ['.js', '.jsx'],
};