Skip to content

Commit 79db65a

Browse files
committed
Update json assertion
1 parent 5dc1dea commit 79db65a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ class Main {
9797
},
9898
copy: {
9999
helpers: {
100-
addJsonImportAssertions(dir) {
100+
addJsonImportAssertions: (dir) => {
101101
fs.readdirSync(dir).forEach(file => {
102102
const fullPath = path.join(dir, file);
103103
if (fs.lstatSync(fullPath).isDirectory()) {
104-
addJsonImportAssertions(fullPath);
104+
this.#_helpers.copy.helpers.addJsonImportAssertions(fullPath);
105105
} else if (file.endsWith('.js') || file.endsWith('.mjs')) {
106106
let content = fs.readFileSync(fullPath, 'utf8');
107107
content = content.replace(/import\s+(.*?)\s+from\s+(['"])(.*?)\.json\2\s*;/g, (match, imports, quote, modulePath) => {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nasriya/postbuild",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"description": "A package that does some tasks after compilation",
55
"main": "main.js",
66
"type": "module",

0 commit comments

Comments
 (0)