Skip to content

Commit 85ff3cb

Browse files
committed
refactor: Package type changed to be module instead of CommonJS
1 parent 5b0280b commit 85ff3cb

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## Change log
22

3+
### Version: 4.3.0
4+
#### Date: October-14-2024
5+
Refactor: Package type changed to be module instead of CommonJS
6+
37
### Version: 4.3.0
48
#### Date: Septmber-09-2024
59
Feat: Include refernce accepts array of values

config/webpack.config.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
const path = require('path');
1+
import path, { dirname } from 'path';
2+
import { fileURLToPath } from 'url';
23

3-
module.exports = {
4+
// Replicating __dirname in ES modules
5+
const __filename = fileURLToPath(import.meta.url);
6+
const __dirname = dirname(__filename);
7+
8+
export default {
49
mode: 'production',
510
entry: './src/index.ts',
611
output: {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@contentstack/delivery-sdk",
3-
"version": "4.3.0",
4-
"type": "commonjs",
3+
"version": "4.4.0",
4+
"type": "module",
55
"main": "./dist/cjs/src/index.js",
66
"types": "./dist/types/src/index.d.ts",
77
"scripts": {

tools/cleanup.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
const fs = require('fs');
2-
const path = require('path');
1+
import fs from 'fs';
2+
import { fileURLToPath } from 'url';
3+
import path, { dirname } from 'path';
4+
5+
const __filename = fileURLToPath(import.meta.url);
6+
const __dirname = dirname(__filename);
37

48
// To remove the relative path
59
function sanitizePath(str) {

0 commit comments

Comments
 (0)