onRun(compiler, done)
    {
        const basePath = compiler.context || process.cwd();

        this.outputFile = path.resolve(basePath, this.outputFile);

        fs.access(this.outputFile, fs.R_OK | fs.W_OK, (err) =>
        {
            if (err && err.code !== 'ENOENT') return done(err);

            // At this point it either exists, and we can write to it, or
            // it doesn't exist at all. Either way, we can continue.

            // set entry string with export for core.
            let str = 'export * from \'@fae/core\';\n\n';

            this.loadPluginData((err, pluginData) =>
            {
                if (err) return done(err);

                // add exports for each plugin
                for (let i = 0; i < pluginData.length; ++i)
                {
                    const data = pluginData[i];

                    if (data.name === 'core') continue;

                    const pkg = data.pkg;
                    const namespace = pkg.fae && pkg.fae.namespace ? pkg.fae.namespace : pkg.name.replace('@fae/', '').replace('-', '_'); // eslint-disable-line max-len

                    str += `import * as ${namespace} from '${data.pkg.name}';\n`;
                    str += `export { ${namespace} };\n\n`;
                }

                // write exports and update entry
                fs.writeFile(this.outputFile, str, done);

                return null;
            });

            return null;
        });
    }
/**
     * Called by webpack when starting to run the compiler.
     *
     * @param {object} compiler - The webpack compiler object.
     * @param {function} done - Callback to call when complete.
     */
Called by webpack when starting to run the compiler.
@param {object} compiler - The webpack compiler object.
@param {function} done - Callback to call when complete.
Called by webpack when starting to run the compiler . @param { object } compiler - The webpack compiler object . @param { function } done - Callback to call when complete .
onRun(compiler, done)
    {
        const basePath = compiler.context || process.cwd();
        this.outputFile = path.resolve(basePath, this.outputFile);
        fs.access(this.outputFile, fs.R_OK | fs.W_OK, (err) =>
        {
            if (err && err.code !== 'ENOENT') return done(err);
            let str = 'export * from \'@fae/core\';\n\n';
            this.loadPluginData((err, pluginData) =>
            {
                if (err) return done(err);
                for (let i = 0; i < pluginData.length; ++i)
                {
                    const data = pluginData[i];
                    if (data.name === 'core') continue;
                    const pkg = data.pkg;
                    const namespace = pkg.fae && pkg.fae.namespace ? pkg.fae.namespace : pkg.name.replace('@fae/', '').replace('-', '_'); 
                    str += `import * as ${namespace} from '${data.pkg.name}';\n`;
                    str += `export { ${namespace} };\n\n`;
                }
                fs.writeFile(this.outputFile, str, done);
                return null;
            });
            return null;
        });
    }
onRun ( compiler , done ) { const basePath = compiler . context || process . cwd ( ) ; this . outputFile = path . resolve ( basePath , this . outputFile ) ; fs . access ( this . outputFile , fs . R_OK | fs . W_OK , ( err ) => { if ( err && err . code !== 'ENOENT' ) return done ( err ) ; let str = 'export * from \'@fae/core\';\n\n' ; this . loadPluginData ( ( err , pluginData ) => { if ( err ) return done ( err ) ; for ( let i = 0 ; i < pluginData . length ; ++ i ) { const data = pluginData [ i ] ; if ( data . name === 'core' ) continue ; const pkg = data . pkg ; const namespace = pkg . fae && pkg . fae . namespace ? pkg . fae . namespace : pkg . name . replace ( '@fae/' , '' ) . replace ( '-' , '_' ) ; str += ` ${ namespace } ${ data . pkg . name } \n ` ; str += ` ${ namespace } \n \n ` ; } fs . writeFile ( this . outputFile , str , done ) ; return null ; } ) ; return null ; } ) ; }
Called by webpack when starting to run the compiler.
Called by webpack when starting to run the compiler .
// At this point it either exists, and we can write to it, or // it doesn't exist at all. Either way, we can continue. // set entry string with export for core. // add exports for each plugin // eslint-disable-line max-len // write exports and update entry