Skip to content

Commit

Permalink
fix: cache babel loader based on untyped version (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Jul 22, 2021
1 parent b8f351c commit bc6f679
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/loader/babel.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import type { PluginObj } from '@babel/core'
import type { ConfigAPI, PluginItem, PluginObj } from '@babel/core'
import * as t from '@babel/types'
import { Schema, JSType, TypeDescriptor, FunctionArg } from '../types'
import { normalizeTypes, mergedTypes, cachedFn } from '../utils'

import { version } from '../../package.json'

type GetCodeFn = (loc: t.SourceLocation) => string

export default function babelPluginUntyped () {
export default <PluginItem> function babelPluginUntyped (api: ConfigAPI) {
api.cache.using(() => version)

return <PluginObj>{
visitor: {
VariableDeclaration (p) {
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"compilerOptions": {
"target": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"esModuleInterop": true,
"strict": false,
"types": [
Expand Down

0 comments on commit bc6f679

Please sign in to comment.