Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions docs/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,16 @@ Then modify the webpack config to use it as a plugin:

```js
// config/webpack/webpack.config.js
const { webpackConfig, merge } = require("shakapacker");
const ForkTSCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
const { generateWebpackConfig, merge } = require('shakapacker')
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');

module.exports = merge(webpackConfig, {
plugins: [new ForkTSCheckerWebpackPlugin()],
});
const webpackConfig = generateWebpackConfig()

module.exports = merge(
Copy link
Contributor

Choose a reason for hiding this comment

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

not blocking, but fwiw this can be simplified further as generateWebpackConfig now takes a config to be merged in:

module.exports = generateWebpackConfig({
    plugins: [new ForkTsCheckerWebpackPlugin()]
});

webpackConfig, {
plugins: [new ForkTsCheckerWebpackPlugin()]
}
);
```

Doing this will allow React-Rails to support the .tsx extension. Additionally, it is recommended to add `ts` and `tsx` to the `server_renderer_extensions` in your application configuration:
Expand Down