Title: Importing files other than TS modules · Issue #2709 · microsoft/TypeScript · GitHub
Open Graph Title: Importing files other than TS modules · Issue #2709 · microsoft/TypeScript
X Title: Importing files other than TS modules · Issue #2709 · microsoft/TypeScript
Description: I've successfully been using SystemJS and TypeScript for a while now. I've been about to use the CommonJS syntax to easily import other TS modules, as well as other resources: var OtherModule = require("./othermodule"); var Html = Open Graph Description: I've successfully been using SystemJS and TypeScript for a while now. I've been about to use the CommonJS syntax to easily import other TS modules, as well as other resources: var OtherModule = req...
X Description: I've successfully been using SystemJS and TypeScript for a while now. I've been about to use the CommonJS syntax to easily import other TS modules, as well as other resources: var OtherModu...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/2709
X: @github
Domain: github.com
Links:
Viewport: width=device-width
Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Importing files other than TS modules","articleBody":"I've successfully been using SystemJS and TypeScript for a while now. I've been about to use the CommonJS syntax to easily import other TS modules, as well as other resources:\n\n```\nvar OtherModule = require(\"./othermodule\");\nvar Html = \u003cstring>require(\"./template.html!text\");\nrequire(\"./template.css!\");\n```\n\nThis is made possible by simply declaring the following function:\n\n```\ndeclare function require(name: string): any;\n```\n\nI'm now trying to do the same with the new ES6 syntax:\n\n```\nimport { OtherModule } from \"./othermodule\"; // Works\nimport \"./template.css!\"; // Works\nimport Html from require(\"./template.html!text\"); // Nope - 'Cannot find external module'\n```\n\nOf course I can do the same as before and declare and use 'require', but it'd be nice to keep it consistent. Perhaps assume that if an exclamation mark is in the path, then don't assume it's a TypeScript import?\n","author":{"url":"https://github.com/jamiewinder","@type":"Person","name":"jamiewinder"},"datePublished":"2015-04-10T11:12:30Z","url":"https://github.com/microsoft/TypeScript/issues/2709"}
react-profiling 0 react-import-map react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 route-pattern /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) route-controller voltron_issues_fragments route-action issue_layout fetch-nonce v2:870d6ece-833a-0a5b-3fa1-b9b919dfe220 current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id 9678:10AA8F:259155:33882D:6AFBB146 html-safe-nonce ac5814cee32db3b834d2fceeec66957e72333268a8dd780845e0770df6a09f93 visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Njc4OjEwQUE4RjoyNTkxNTU6MzM4ODJEOjZBRkJCMTQ2IiwidmlzaXRvcl9pZCI6IjQwMTg3Mzk0OTU1MTQ2NDg5MDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== visitor-hmac 28412bc0cd7fc6509721d32a5e6f62153a1260e6f7ac52dd9ce0c2c452ee1fa2 hovercard-subject-tag issue:67570753 github-keyboard-shortcuts repository,issues,copilot google-site-verification Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I octolytics-url https://collector.github.com/github/collect analytics-location / fb:app_id 1401488693436528 apple-itunes-app app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/2709/issue_layout twitter:image https://opengraph.githubassets.com/ffe35e438565db6b0453b82eda7ada3698afb4bc93b7655663bbcf04fb461827/microsoft/TypeScript/issues/2709 twitter:card summary_large_image og:image https://opengraph.githubassets.com/ffe35e438565db6b0453b82eda7ada3698afb4bc93b7655663bbcf04fb461827/microsoft/TypeScript/issues/2709 og:image:alt I've successfully been using SystemJS and TypeScript for a while now. I've been about to use the CommonJS syntax to easily import other TS modules, as well as other resources: var OtherModule = req... og:image:width 1200 og:image:height 600 og:site_name GitHub og:type object og:author:username jamiewinder hostname github.com expected-hostname github.com None e25fbd830d3e6ad0e8935c105cf4fdc70c593dffcd27bb45b790ae4fece5ea55 turbo-cache-control no-preview go-import github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git octolytics-dimension-user_id 6154722 octolytics-dimension-user_login microsoft octolytics-dimension-repository_id 20929025 octolytics-dimension-repository_nwo microsoft/TypeScript octolytics-dimension-repository_public true octolytics-dimension-repository_is_fork false octolytics-dimension-repository_network_root_id 20929025 octolytics-dimension-repository_network_root_nwo microsoft/TypeScript turbo-body-classes logged-out env-production page-responsive disable-turbo false browser-stats-url https://api.github.com/_private/browser/stats browser-errors-url https://api.github.com/_private/browser/errors release 08c8f17f9d27054a108b8b6254e405de0151f660 ui-target full theme-color #1e2327 color-scheme light dark react-app-name issues
URLs of crawlers that visited me.