Skip to content

Commit

Permalink
Update get-started.md
Browse files Browse the repository at this point in the history
Using webpackconfig throws a deprecation warning and encourages user to use generateWebpackConfig() instead.
  • Loading branch information
chmod600 authored Apr 27, 2024
1 parent 6b65463 commit 02a5b72
Showing 1 changed file with 9 additions and 5 deletions.
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(
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

0 comments on commit 02a5b72

Please sign in to comment.