import { updateText } from './module' ; import './style.scss' ; import './style.less' ; declare const module ; const mainNode = document . querySelector ( '#ts-app' ) ; if ( mainNode ) { updateText ( mainNode , 'I am ts app' ) ; } function add ( a ) { return a + 10 ; } console . log ( add ( 10 ) ) ; import ( './dynamic' ) . then ( ( { updateNode } ) => { const dynNode = document . querySelector ( '#ts-dyn-app' ) ; if ( dynNode ) { updateNode ( dynNode , 'I am dynamically imported from ts module' ) ; } } ) ; if ( module . hot ) { module . hot . accept ( './module' , ( ) => { const { updateText } = require ( './module' ) ; updateText ( mainNode , 'I am HMRed' ) ; } ) ; }