-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Remove "type" from package.json in deployed version to support o…
…lder versions (#117)
- Loading branch information
Showing
3 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* eslint-disable no-undef */ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
// app-router로 마이그레이션하면 제거될 코드입니디. | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
const packagePath = path.resolve(__dirname, '..', 'package.json'); | ||
|
||
fs.readFile(packagePath, 'utf8', (err, data) => { | ||
if (err) { | ||
console.error(err); | ||
return; | ||
} | ||
|
||
const packageJson = JSON.parse(data); | ||
delete packageJson.type; | ||
|
||
fs.writeFile(packagePath, JSON.stringify(packageJson, null, 2), 'utf8', err => { | ||
if (err) { | ||
console.error(err); | ||
return; | ||
} | ||
console.log('The "type" key has been removed from the package.json file.'); | ||
}); | ||
}); |