Skip to content

Commit

Permalink
[fix] remove "import" statements in CJS bundle by downgrade to Parcel…
Browse files Browse the repository at this point in the history
… 2.6
  • Loading branch information
TechQuery committed Sep 5, 2022
1 parent 6cc9b28 commit 74e7fb1
Show file tree
Hide file tree
Showing 3 changed files with 369 additions and 372 deletions.
2 changes: 0 additions & 2 deletions bundle-fix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ const CJS_pattern = /require\(('|").+?('|")\)/;

code = code.replace(CSS_pattern, '').trim();

if (isCJS) code = code.replace(/import(".+?")/g, 'require($1)');

await promises.writeFile(file, code);

console.log(`[fixed] ${file}`);
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "idea-react",
"version": "0.26.9",
"version": "0.26.10",
"license": "LGPL-3.0",
"author": "[email protected]",
"description": "A React advanced components library based on TypeScript & Bootstrap, built by idea2app remote developers team.",
Expand Down Expand Up @@ -38,9 +38,9 @@
"web-utility": "^3.9.2"
},
"devDependencies": {
"@parcel/packager-ts": "~2.7.0",
"@parcel/transformer-less": "~2.7.0",
"@parcel/transformer-typescript-types": "~2.7.0",
"@parcel/packager-ts": "~2.6.2",
"@parcel/transformer-less": "~2.6.2",
"@parcel/transformer-typescript-types": "~2.6.2",
"@types/lodash": "^4.14.184",
"@types/node": "^14.18.27",
"@types/prismjs": "^1.26.0",
Expand All @@ -50,7 +50,7 @@
"less": "^4.1.3",
"lint-staged": "^13.0.3",
"open-cli": "^7.0.1",
"parcel": "~2.7.0",
"parcel": "~2.6.2",
"prettier": "^2.7.1",
"ts-node": "^10.9.1",
"typedoc": "^0.23.14",
Expand Down
Loading

1 comment on commit 74e7fb1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for idea-react ready!

✅ Preview
https://idea-react-82sglyjrx-stevending1st.vercel.app

Built with commit 74e7fb1.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.