What does "_entry_return_" in webpack mean?

Viewed 117

After reading the documentation I still can't understand what is_entry_return_. I have an example

var MyLibrary = _entry_return_;

// In a separate script...
MyLibrary.doSomething();

I compiled my code, with these output properties

 output: {
        library: 'abc',
        libraryTarget: 'assign',
        libraryExport: 'default',
        filename: 'abc.js',
        path: path.resolve(__dirname, 'distN'),
      },

how da heck can i access to my function exported as

export default function run() {console.log('nothing')}

Am I doing something wrong? as I understood I already must have this variable as a global one, but I have not. I want to use it inside my node.js Thanks in advance!

1 Answers

_entry_return_ is just a sample name indicating whatever returned from your entry.

so according to your config, you can access the exported function like this:

node

require('apath/to/abc.js');
abc() // it's defined in global

browser

<script src="https://example.org/path/to/abc.js"></script>
<script>abc()</script>
Related