title: Using globalize with webpack 2 and typescript
body: <p>I am trying to use the <a href="https://github.com/globalizejs/globalize" rel="nofollow noreferrer">Globalize library</a> with <a href="https://webpack.js.org/" rel="nofollow noreferrer">webpack 2</a> in a TypeScript project.
  The typescript/Webpack 2 setup already works, however, when importing and accessing Globalize, I am getting the following error message when running webpack:</p>
  
  <pre><code>ERROR in ./.tmp-globalize-webpack/C--Projects-webpack2-testing-app-index.ts
  (1,1): error TS2304: Cannot find name 'module'.
  
  ERROR in ./app/index.ts
  (2,23): error TS7016: Could not find a declaration file for module 'globalize'. 'C:\Projects\webpack2-testing\node_modules\globalize\dist\node-main.js' implicitly has an 'any' type.
  </code></pre>
  
  <p>So I tried installing the globalize types:</p>
  
  <pre><code>npm install --save-dev @types/globalize
  </code></pre>
  
  <p>Now I get the following error:</p>
  
  <pre><code>ERROR in ./.tmp-globalize-webpack/C--Projects-webpack2-testing-app-index.ts
  (1,1): error TS2304: Cannot find name 'module'.
  
  ERROR in ./app/index.ts
  (2,23): error TS2306: File 'C:/Projects/webpack2-testing/node_modules/@types/globalize/index.d.ts' is not a module.
  </code></pre>
  
  <p>Unfotunately this is all very new to me. Don't know if I should check webpack or typings or globalize or typescript...</p>
  
  <p>This is my package.json:</p>
  
  <pre><code>{
  "name": "webpack2-testing",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
    "scripts": {
      "test": "echo \"Error: no test specified\" &amp;&amp; exit 1",
      "build": "webpack --config webpack-config.js"
    },
    "devDependencies": {
      "cldr-data": "^30.0.4",
      "globalize": "^1.2.2",
      "globalize-webpack-plugin": "^0.3.10",
      "html-webpack-plugin": "^2.28.0",
      "ts-loader": "^2.0.0",
      "typescript": "^2.1.6",
      "webpack": "^2.2.1"
    }
  }
  </code></pre>
  
  <p>and the index.ts:</p>
  
  <pre><code>import Globalize from "globalize";
  
  function component () {
    let element = document.createElement('div');
  
    let currencyFormatter = Globalize.currencyFormatter( "USD" );
    element.innerHTML = currencyFormatter( 69900 );
    return element;
  }
  
  document.body.appendChild(component());
  </code></pre>
  
  <p>The complete project files (including webpack-config) are available at <a href="https://github.com/dominic-simplan/webpack2-testing" rel="nofollow noreferrer">this github repository</a>.</p>
  
  <p>Note: This question arose while trying to solve a <a href="https://stackoverflow.com/questions/42208273/module-loader-for-typescript-application-running-locally-no-webserver-used">question I asked previously</a>. If this works, it could also resolve my previous question.</p>