Greetings! I have a TypeScript/jQuery/Webpack application with all the latest releases, and everything seems to be functioning properly. Now, I am attempting to integrate the aws-sdk into it. I followed the same approach I used for importing other libraries like '_' which have been successful.
import * as _ from '../node_modules/lodash-es/lodash';
However, when I try to run it, I encounter a series of errors like the ones below:
ERROR in .../code-projects/.../tsconfig.json
error TS2318: Cannot find global type 'Number'.
ERROR in .../code-projects/.../tsconfig.json
error TS2318: Cannot find global type 'Object'.
ERROR in .../code-projects/.../tsconfig.json
error TS2318: Cannot find global type 'RegExp'.
ERROR in .../code-projects/.../tsconfig.json
error TS2318: Cannot find global type 'String'.
I then followed the guidelines from the aws-sdk documentation for TypeScript.
Still, I faced the same outcome.
The import statement I used is as follows:
import * as AWS from '../node_modules/aws-sdk/dist/aws-sdk';
Oddly enough, WebStorm does not raise any red flags, and the autocomplete feature works flawlessly.
I have included my Webpack configuration below in case it might provide some clarity.
Question: Could you advise me on the correct method to incorporate the aws-sdk into this particular type of setup?
const webpack = require('webpack');
const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: [
"bootstrap-webpack",
'./src/index.ts'
],
// Other webpack configuration settings...
};