-
-
Notifications
You must be signed in to change notification settings - Fork 631
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ESLint errors, Add source reference to each config file
- Loading branch information
Showing
10 changed files
with
83 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
lib/generators/react_on_rails/templates/base/base/config/webpack/clientWebpackConfig.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
lib/generators/react_on_rails/templates/base/base/config/webpack/commonWebpackConfig.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 13 additions & 29 deletions
42
lib/generators/react_on_rails/templates/base/base/config/webpack/development.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,24 @@ | ||
// The source code including full typescript support is available at: | ||
// https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh/blob/master/config/webpack/development.js | ||
|
||
process.env.NODE_ENV = process.env.NODE_ENV || 'development' | ||
|
||
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin') | ||
const path = require('path') | ||
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin') | ||
|
||
const { devServer, inliningCss } = require('@rails/webpacker') | ||
|
||
const webpackConfig = require('./webpackConfig') | ||
|
||
const developmentEnvOnly = (clientWebpackConfig, serverWebpackConfig) => { | ||
|
||
const isWebpackDevServer = process.env.WEBPACK_DEV_SERVER | ||
|
||
//plugins | ||
if (inliningCss ) { | ||
const developmentEnvOnly = (clientWebpackConfig, _serverWebpackConfig) => { | ||
// plugins | ||
if (inliningCss) { | ||
// Note, when this is run, we're building the server and client bundles in separate processes. | ||
// Thus, this plugin is not applied. | ||
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin') | ||
clientWebpackConfig.plugins.push( | ||
new ReactRefreshWebpackPlugin({ | ||
overlay:{ | ||
sockPort: devServer.port | ||
} | ||
}) | ||
) | ||
clientWebpackConfig.plugins.push(new ReactRefreshWebpackPlugin({ | ||
overlay: { | ||
sockPort: devServer.port, | ||
}, | ||
})) | ||
} | ||
|
||
// To support TypeScript type checker on a separate process uncomment the block below and add tsconfig.json | ||
// to the root directory. | ||
// As a reference visit https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh/blob/master/config/webpack/development.js | ||
|
||
// clientWebpackConfig.plugins.push( | ||
// new ForkTsCheckerWebpackPlugin({ | ||
// typescript: { | ||
// configFile: path.resolve(__dirname, '../../tsconfig.json') | ||
// }, | ||
// async: false | ||
// }) | ||
// ) | ||
} | ||
module.exports = webpackConfig(developmentEnvOnly) |
5 changes: 3 additions & 2 deletions
5
lib/generators/react_on_rails/templates/base/base/config/webpack/production.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
lib/generators/react_on_rails/templates/base/base/config/webpack/test.js
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
lib/generators/react_on_rails/templates/base/base/config/webpack/webpackConfig.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters