Я использую webpack
с версией 4.8.1 для комплектации typescript
, которая имеет версию 2.8.1, но когда я использую этот комплект js
в браузере, я получаю ошибку Void 0 is not function
. Вот мой веб-пакет.Файл config.js
var glob = require("glob")module.exports={
entry:{
LiveAgentApplication:"./Scripts/LiveAgent.Application.ts"
},output: {
path:__dirname+'/dist',
filename: '[name].bundle.js'
},module: {
rules: [
{ test: /\.ts$/, loader: 'ts-loader' }
]
},optimization: {
minimize: false
}}
Вот мой tsconfig.js
{
"compilerOptions": {
"target": "es5",
"module": "system",
"noImplicitAny": false,
"removeComments": true,
"preserveConstEnums": true,
"outFile": "../../built/local/tsc.js",
"sourceMap": true,
"allowJs": true,
"moduleResolution": "node"
},
"include": [
"./Scripts/*"
],
"exclude": [
"node_modules",
"**/*.spec.ts"
]}
И package.json выглядит следующим образом:
{"name": "Resources",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"refreshVSToken ": "vsts-npm-auth -config .npmrc"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"geofluent-bundle": "^1.0.3",
"geofluent-chat-translation-bundle": "^1.0.2",
"geofluent-common-bundle": "^1.0.3",
"geofluent-itranslator-bundle": "^1.0.6",
"geofluent-sdk-bundle": "^1.0.1",
"geofluent-tokenizer-bundle": "^1.0.4",
"install": "^0.11.0",
"jquery": "^3.3.1",
"npm": "^5.8.0",
"ts-loader": "^4.2.0",
"webpack": "^4.8.1",
"webpack-cli": "^2.1.3",
"webpack-system-register": "^1.6.0",
},"devDependencies": {
"@types/jquery": "^3.3.1"
}}
Примечание:некоторые из используемых мной узловых модулей размещены в частном реестре NPM нашей организации