Skip to content

Commit

Permalink
Revert "chore: configure for esm (#29)" (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
ojeytonwilliams authored May 22, 2024
1 parent 0a5e5a2 commit 5d1980b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 22 deletions.
15 changes: 15 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
presets: [
"@babel/preset-react",
"@babel/preset-typescript",
[
"@babel/preset-env",
{
targets: {
browsers: [">0.25%", "not dead"],
},
},
],
],
plugins: [["transform-react-remove-prop-types", { removeImport: true }]],
};
15 changes: 0 additions & 15 deletions babel.config.json

This file was deleted.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"author": "freeCodeCamp <[email protected]>",
"license": "BSD-3-Clause",
"description": "The freeCodeCamp.org open-source UI components",
"type": "module",
"main": "dist/bundle.js",
"module": "dist/bundle.es.js",
"style": "dist/base.css",
Expand Down Expand Up @@ -42,7 +41,7 @@
"storybook": "storybook dev -p 6006 --no-open",
"storybook:theming": "pnpm run storybook --no-manager-cache",
"clean": "rm -rf dist/*",
"gen-component": "tsx ./utils/gen-component-script",
"gen-component": "ts-node ./utils/gen-component-script",
"test": "jest",
"prepare": "husky",
"typecheck": "tsc"
Expand Down
7 changes: 3 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
{
"compilerOptions": {
"module": "ES2022",
"module": "ES6",
"target": "ES6",
"sourceMap": true,
"jsx": "react",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"moduleResolution": "Bundler",
"moduleResolution": "node",
"strict": true,
"noEmit": true,
"skipLibCheck": true
},
"ts-node": {
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "Node10" // Unfortunately we're stuck with this until Jest stops using ts-node
"module": "commonjs"
},
"transpileOnly": true
}
Expand Down
2 changes: 1 addition & 1 deletion utils/gen-component-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const toKebabCase = (pascalCasedName: string) =>

const kebabCasedName = toKebabCase(name);

const dir = path.join(import.meta.dirname, `../src/${kebabCasedName}`);
const dir = path.join(__dirname, `../src/${kebabCasedName}`);

// Throw an error if the component's folder already exists
if (fs.existsSync(dir)) {
Expand Down

0 comments on commit 5d1980b

Please sign in to comment.