Skip to content

Commit

Permalink
fixed css-loader instalation and css import in example files (#1634)
Browse files Browse the repository at this point in the history
  • Loading branch information
vaukalak authored Jun 25, 2024
1 parent 2f023ec commit 76c6b50
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Please follow the recommendations outlined at [keepachangelog.com](http://keepac
### [Unreleased]
Changes since the last non-beta release.

#### Fixed
- Fixed css-loader installation with [PR 1634](https://github.com/shakacode/react_on_rails/pull/1634) by [vaukalak](https://github.com/vaukalak)
#### Fixed
- Address a number of typos and grammar mistakes [PR 1631](https://github.com/shakacode/react_on_rails/pull/1631) by [G-Rath](https://github.com/G-Rath)

Expand Down
5 changes: 3 additions & 2 deletions lib/generators/react_on_rails/base_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def copy_base_files
def copy_js_bundle_files
base_path = "base/base/"
base_files = %w[app/javascript/packs/server-bundle.js
app/javascript/bundles/HelloWorld/components/HelloWorldServer.js]
app/javascript/bundles/HelloWorld/components/HelloWorldServer.js
app/javascript/bundles/HelloWorld/components/HelloWorld.module.css]
base_files.each { |file| copy_file("#{base_path}#{file}", file) }
end

Expand Down Expand Up @@ -91,7 +92,7 @@ def add_yarn_dependencies

puts "Adding CSS handlers"

run "yarn add css-loader css-minimizer-webpack-plugin mini-css-extract-plugin style-loader@"
run "yarn add -D css-loader css-minimizer-webpack-plugin mini-css-extract-plugin style-loader"

puts "Adding dev dependencies"
run "yarn add -D @pmmmwh/react-refresh-webpack-plugin react-refresh"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PropTypes from 'prop-types';
import React, { useState } from 'react';
import style from './HelloWorld.module.css';
import * as style from './HelloWorld.module.css';

const HelloWorld = (props) => {
const [name, setName] = useState(props.name);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PropTypes from 'prop-types';
import React from 'react';
import style from './HelloWorld.module.css';
import * as style from './HelloWorld.module.css';

const HelloWorld = ({ name, updateName }) => (
<div>
Expand Down

0 comments on commit 76c6b50

Please sign in to comment.