-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Labels
Description
Package Version: 2.2.3
To Reproduce
Steps to reproduce the behavior:
- npm init
- npm install @azure/ms-rest-js ts-loader webpack webpack-cli
- Create index.ts
- Create webpack.config.js
- Create tsconfig.json
- Run npx webpack
index.js
import * as msRest from "@azure/ms-rest-js";
console.log(msRest);
webpack.config.js*
const webpack = require('webpack');
const bundleOutputDir = './dist';
module.exports = (env) => {
return [{
entry: {
'index': './index',
},
resolve: {
extensions: ['.ts']
},
output: {
path: path.join(__dirname, bundleOutputDir),
filename: '[name].js',
},
module: {
rules: [
{
test: /\.js|.ts?$/, loader: 'ts-loader'
}
],
},
}];
};
tsconfig.json
Make sure that allowJs set to true
{
"compilerOptions": {
"moduleResolution": "node",
"target": "ES2019",
"strict": true,
"module": "commonjs",
"allowJs": true,
},
"exclude": [
"node_modules",
"dist",
"webpack.config.js"
]
}
package.json
{
"name": "msrestjs",
"version": "1.0.0",
"main": "index.ts",
"scripts": {
"test": "webpack"
},
"dependencies": {
"@azure/ms-rest-js": "2.2.3",
"ts-loader": "8.0.17",
"webpack": "5.24.2",
"webpack-cli": "4.5.0"
}
}
** Error output **
ERROR in ...\node_modules\@azure\ms-rest-js\es\lib\msRest.js
./node_modules/@azure/ms-rest-js/es/lib/msRest.js 3:21-37
[tsl] ERROR in ...\node_modules\@azure\ms-rest-js\es\lib\msRest.js(3,22)
TS6053: File '.../node_modules/@azure/ms-rest-js/es/dom-shim.d.ts' not found.
Expected behavior
Compilation without errors
Reactions are currently unavailable