Skip to content

Commit

Permalink
feat: Re-enable typescript for production builds
Browse files Browse the repository at this point in the history
build: Add .ts/.tsx extensions to webpack resolver

chore: Add ending newline to Image.tsx

build: Use typescript config from @edx/eslint-config

chore: formatting
  • Loading branch information
marlonkeating authored and muselesscreator committed Aug 7, 2023
1 parent ca26dca commit 93b1cc2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 19 deletions.
20 changes: 20 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,26 @@ In some scenarios, you may want to run a production Webpack build locally. To se
#. Add an NPM script ``serve`` to your application's ``package.json`` (i.e., ``"serve": "fedx-scripts serve"``).
#. Run ``npm run serve`` to serve your production build assets. It will attempt to run the build on the same port specified in the ``env.config.js`` file.

Local module configuration for TypeScript
-----------------------------------------

#. Create file in repository `tsconfig.json`, with a clause `"extends": "@edx/frontend-build"`
#. Set "rootDir" to the root of the source code folders
#. Set "include" to wildcard patterns specifying the subdirectories/files under rootDir where source code can be found
#. Include any wildcards under rootDir that should be excluded using "exclude"

```Sample json
{
"extends": "@edx/frontend-build",
"compilerOptions": {
"rootDir": ".",
"outDir": "dist"
},
"include": ["src/**/*"],
"exclude": ["dist", "node_modules"]
}
```

Development
-----------

Expand Down
19 changes: 0 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"@svgr/webpack": "8.0.1",
"@edx/eslint-config": "4.0.0-alpha.1",
"@edx/typescript-config": "^1.0.0",
"@types/jest": "^26.0.0",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"autoprefixer": "10.4.14",
"babel-jest": "26.6.3",
"babel-loader": "9.1.3",
Expand Down Expand Up @@ -82,6 +87,8 @@
"ts-jest": "^26.5.0",
"typescript": "^4.9.4",
"style-loader": "3.3.3",
"ts-jest": "^26.5.0",
"typescript": "^4.9.4",
"url-loader": "4.1.1",
"webpack": "5.88.2",
"webpack-bundle-analyzer": "4.9.0",
Expand Down

0 comments on commit 93b1cc2

Please sign in to comment.