zl程序教程

您现在的位置是:首页 >  前端

当前栏目

[Poi] Use Poi to Build an Index.js with Modern JavaScript Features

JavaScriptJS to with an use index build
2023-09-14 09:00:50 时间

Poi can easily launch an index.js file simply by running the poi command. This will launch a dev-server and automatically reload whenever you make changes. You can also npm install any package you need and import it right away.

 

Install:

npm install -g poi

 

Code:

// src/index.js

import {Observable} from 'rxjs';

Observable.intervable(1000).subscribe(
  i = > document.getElementById("app").innerHTML = `
      <h1>{i}</h1>
`
)

 

Run:

poi src/index --port 3000