-
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.
Merge pull request #6 from avolutions/develop
Develop
- Loading branch information
Showing
2 changed files
with
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { promises as fs } from 'fs'; | ||
import path from 'path'; | ||
import { fileURLToPath } from 'url'; | ||
|
||
// Use fileURLToPath to get the directory for ES modules | ||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
|
||
// Define the package.json content | ||
const packageJsonContent = { | ||
type: "commonjs" | ||
}; | ||
|
||
// Define the path to the output package.json | ||
const outputPath = path.join(__dirname, '..', 'dist', 'cjs', 'package.json'); | ||
|
||
// Ensure the directory exists and write the file asynchronously | ||
await fs.mkdir(path.dirname(outputPath), { recursive: true }); | ||
await fs.writeFile(outputPath, JSON.stringify(packageJsonContent, null, 2)); |