Rx javascript: Difference between revisions

From bibbleWiki
Jump to navigation Jump to search
Line 1: Line 1:
=Introduction=
=Introduction=
==Packages==
The course used the following tools
The course used the following tools
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
Line 12: Line 13:
     "webpack-dev-server": "^3.11.0"
     "webpack-dev-server": "^3.11.0"
   }
   }
</syntaxhighlight>
==Typescript Configuration==
I used the following tsconfig.json.
<syntaxhighlight lang="json">
{
    "compilerOptions": {
        "target": "ES5",
        "module": "commonjs",
        "sourceMap": true
    }
}
</syntaxhighlight>
==Webpack Configuration==
Specify
* the entry point
* the output file
* add script tag to index.html
* Provide module loaders, which consists of a test and which loader to use
* Provide how Webpack should resolve modules
<syntaxhighlight lang="json">
</syntaxhighlight>
And the main.ts
<syntaxhighlight lang="ts">
alert("ok")
</syntaxhighlight>
And in the Index.html
<syntaxhighlight lang="html">
<html>
<head>
<title>RxJs</title>
</head>
<body>
<div>hello</div>
<script src="app.js"></script>
</body>
</html>
</syntaxhighlight>
</syntaxhighlight>

Revision as of 03:10, 2 September 2020

Introduction

Packages

The course used the following tools

 "dependencies": {
    "rxjs": "^6.6.2"
  },
  "devDependencies": {
    "ts-loader": "^8.0.3",
    "typescript": "^4.0.2",
    "typings": "^2.1.1",
    "webpack": "^4.44.1",
    "webpack-dev-server": "^3.11.0"
  }

Typescript Configuration

I used the following tsconfig.json.

{
    "compilerOptions": {
        "target": "ES5",
        "module": "commonjs",
        "sourceMap": true
    }
}

Webpack Configuration

Specify

  • the entry point
  • the output file
  • add script tag to index.html
  • Provide module loaders, which consists of a test and which loader to use
  • Provide how Webpack should resolve modules

And the main.ts

alert("ok")

And in the Index.html

<html>
	<head>
		<title>RxJs</title>
	</head>
	<body>
		<div>hello</div>
		<script src="app.js"></script>
	</body>
</html>