how does webpack import from external url
<p>I am using webpack to manage my react application. Now I want to import a dependency from this url: </p>

<pre><code>&lt;script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&amp;ak=gNO2wKVBNupZfafi0bl0sW3dIKqAHn4l"&gt;
</code></pre>

<p>traditionally I just put above code on my index.html file. But now how can I let webpack to load this url? And how my react js use that dependency?</p>

<p>when I launch webpack-dev-server, I will get below error:</p>

<pre><code>ERROR in Entry module not found: Error: Cannot resolve module 'http://api.map.baidu.com/api'
</code></pre>

<p>Then I use little loader to load the url. Below is the javascript code to use loader:</p>

<pre><code>import $ from 'jquery'
import React from 'react';
import ReactDOM from 'react-dom';
import load from 'little-loader';

import './main.css';
import './component';
import Search from './search/search'

load('http://api.map.baidu.com/api?v=2.0&amp;ak=gNO2wKVBNupZfafi0bl0sW3dIKqAHn4l', function(err){
    console.log('err:', err);
});

// document.body.appendChild(component());


ReactDOM.render(&lt;Search /&gt;, document.getElementById('search'));
</code></pre>

<p>but I still got below error when launch webpack:</p>

<pre><code>ERROR in Entry module not found: Error: Cannot resolve module 'http://api.map.baidu.com/api' in /Users/yzzhao/dev/react-demo/webpack_demo
</code></pre>