Skip to content

Commit e391b18

Browse files
committed
fix: replace json import with require
fixes #326
1 parent 7aea0f6 commit e391b18

File tree

3 files changed

+7
-26
lines changed

3 files changed

+7
-26
lines changed

packages/shared/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"url": "git+https://github.com/vuetifyjs/vuetify-loader.git"
1616
},
1717
"scripts": {
18-
"build": "unbuild && node ../../scripts/patchMJS.mjs",
18+
"build": "unbuild",
1919
"dev": "unbuild --stub"
2020
},
2121
"author": "Kael Watts-Deuchar",

packages/shared/src/imports/getImports.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
import { createRequire } from 'node:module'
12
import { parseTemplate, TemplateMatch } from './parseTemplate'
2-
import importMap from 'vuetify/dist/json/importMap.json' assert { type: 'json' }
3-
import importMapLabs from 'vuetify/dist/json/importMap-labs.json' assert { type: 'json' }
43
import { isObject } from '../'
54
import type { Options } from '../'
65

6+
const require = createRequire(import.meta.url)
7+
8+
const importMap = require('vuetify/dist/json/importMap.json') as typeof import('vuetify/dist/json/importMap.json')
9+
const importMapLabs = require('vuetify/dist/json/importMap-labs.json') as typeof import('vuetify/dist/json/importMap-labs.json')
10+
711
export function getImports (source: string, options: Options) {
812
const { components, directives } = parseTemplate(source)
913
const resolvedComponents: TemplateMatch[] = []

scripts/patchMJS.mjs

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)