Skip to content

Instantly share code, notes, and snippets.

View fmoessle's full-sized avatar

Florian Streise fmoessle

View GitHub Profile
@fmoessle
fmoessle / component.vue
Created October 19, 2023 16:51
component.vue
<script lang="ts" setup>
const jsonld = {
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"name": "Books",
"item": "https://example.com/books"
}, {
<script>
export default {
data () {
const jsonld = {
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"name": "Books",
<template>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"name": "Books",
"item": "https://example.com/books"
{
"compilerOptions": {
"baseUrl": "src"
"paths": {
"@utils/*": ["utils/*"],
}
}
}
{
"scripts": {
"dev": "ts-node-dev -r tsconfig-paths/register src/index.ts",
"start": "ts-node -r tsconfig-paths/register src/index.ts"
}
}
{
"scripts": {
"dev": "ts-node-dev src/index.ts",
"start": "ts-node src/index.ts"
}
}
const { pathsToModuleNameMapper } = require('ts-jest/utils')
const { compilerOptions } = require('./tsconfig')
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
// this enables us to use tsconfig-paths with jest
modulePaths: [compilerOptions.baseUrl],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths)
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node'
}
project/
├─ tsconfig.json
├─ package.json
├─ src/
│ ├─ index.ts
│ ├─ utils/
│ │ ├─ file-with-stuff-i-need.ts
import { someFunction } from '@utils/file-with-stuff-i-need'