mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
add test coverage of SWC-TypeScript path aliases for UI and API imports
This commit is contained in:
9
tools/modern-tests/apps/typescript/.swcrc
Normal file
9
tools/modern-tests/apps/typescript/.swcrc
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"jsc": {
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"@ui/*": ["imports/ui/*"],
|
||||
"@api/*": ["imports/api/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { App } from '/imports/ui/App';
|
||||
import { App } from '@ui/App';
|
||||
|
||||
Meteor.startup(() => {
|
||||
const container = document.getElementById('react-target');
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Link, LinksCollection } from '/imports/api/links';
|
||||
import { Link, LinksCollection } from '@api/links';
|
||||
|
||||
async function insertLink({ title, url }: Pick<Link, 'title' | 'url'>) {
|
||||
await LinksCollection.insertAsync({ title, url, createdAt: new Date() });
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
"paths": {
|
||||
/* Support absolute /imports/* with a leading '/' */
|
||||
"/*": ["*"],
|
||||
/* Test aliases */
|
||||
"@ui/*": ["imports/ui/*"],
|
||||
"@api/*": ["imports/api/*"],
|
||||
/* Pull in type declarations for Meteor packages from either zodern:types or @types/meteor packages */
|
||||
"meteor/*": [
|
||||
"node_modules/@types/meteor/*",
|
||||
|
||||
Reference in New Issue
Block a user