title: Webpack lazy loading (promize) end on error
body: <p>I'm very new to webpack and I followed tutorials to set up my config file. I managed to do all I wanted so far, except the lazy loading...</p>
  
  <p>I just did a HMTL page with a button and linked the JS to it. When I click the button, it's supposed to import jquery and change the text color on the page, but i get this error:</p>
  
  <pre><code>Uncaught (in promise) TypeError: $ is not a function
      at eval (app.js?cf22:5)
      at &lt;anonymous&gt;
  (anonymous) @ app.js?cf22:5
  Promise.then (async)
  (anonymous) @ app.js?cf22:4
  </code></pre>
  
  <p>Does anyone know what I'm missing ? did some research but nothing helped me so far :/
  Thanks for your help !</p>
  
  <p>Here's my files:</p>
  
  <p>index.html</p>
  
  <pre><code>    &lt;!DOCTYPE html&gt;
      &lt;html lang="en"&gt;
          &lt;head&gt;
              &lt;meta charset="UTF-8"&gt;
              &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
              &lt;meta http-equiv="X-UA-Compatible" content="ie=edge"&gt;
              &lt;link rel="stylesheet" href="assets/app.css"&gt;
              &lt;title&gt;Test Webpack&lt;/title&gt;
          &lt;/head&gt;
          &lt;body&gt;
              &lt;div&gt;Hello&lt;/div&gt;
              &lt;button id="button"&gt;Click me&lt;/button&gt;
          &lt;/body&gt;
          &lt;footer&gt;
              &lt;script src="assets/app.js"&gt;&lt;/script&gt;
          &lt;/footer&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>app.js</p>
  
  <pre><code>    document.getElementById('button').addEventListener('click', function() {
          import('jquery').then(($) =&gt; {
              $('body').css('color', 'yellow');
          });
      });
  </code></pre>
  
  <p>webpack.config.js</p>
  
  <pre><code>    {
          "name": "webpack-boilerplate",
          "version": "1.0.0",
          "main": "index.js",
          "license": "MIT",
          "scripts": {
              "dev": "cross-env NODE_ENV=dev webpack-dev-server --hot",
              "prod": "cross-env NODE_ENV=prod webpack"
          },
          "devDependencies": {
             "autoprefixer": "^8.1.0",
             "babel-core": "^6.26.0",
             "babel-eslint": "^8.2.2",
             "babel-loader": "^7.1.3",
             "babel-plugin-syntax-dynamic-import": "^6.18.0",
             "babel-preset-env": "^1.6.1",
             "clean-webpack-plugin": "^0.1.18",
             "cross-env": "^5.1.3",
             "css-loader": "^0.28.10",
             "eslint": "^4.18.2",
             "eslint-loader": "^2.0.0",
             "extract-text-webpack-plugin": "^4.0.0-beta.0",
             "file-loader": "^1.1.11",
             "img-loader": "^2.0.1",
             "node-sass": "^4.7.2",
             "postcss-loader": "^2.1.1",
             "remove": "^0.1.5",
             "sass-loader": "^6.0.7",
             "style-loader": "^0.20.2",
             "uglifyjs-webpack-plugin": "^1.2.2",
             "url-loader": "^1.0.1",
             "webpack": "^4.1.0",
             "webpack-cli": "^2.0.10",
             "webpack-dev-server": "^3.1.0",
             "webpack-manifest-plugin": "^2.0.0-rc.2"
          },
          "dependencies": {
             "jquery": "^3.3.1"
          }
      }
  </code></pre>
  
  <p>.babelrc</p>
  
  <pre><code>    {
          "presets": [
              ["env", {
                  "targets": {
                       "browsers": ["last 2 versions", "safari &gt;= 7", "ie &gt;= 7"]
                   }
               }]
          ],
          "plugins": ["syntax-dynamic-import"]
      }
  </code></pre>
  
  <p>.eslintrc</p>
  
  <pre><code>    {
           "parser": "babel-eslint",
            "parserOptions": {
                "sourceType": "module",
                "allowImportExportEverywhere": true,
                "codeFrame": false
            },
            "extends": "eslint:recommended",
            "rules": {
                "semi": ["error", "always"],
                "no-console": "warn",
                "no-unused-vars": "warn"
            },
            "env": {
                "node": true,
                "browser": true,
                "es6": true
            },
            "globals": {
                "console": true
            }
        }
  </code></pre>