How to use require in pxt-sample

when I use require() to import a package, it reports error ‘can not find require’.
If I use ‘import’ to import directly, it will make more error

when I use “import” to replace “require”, I encounter a new error “System is not defined”. And the browser showed me “invalid package xxx: version not specified for xxx”