Skip to content

Commit 76c6b50

Browse files
authored
fixed css-loader instalation and css import in example files (#1634)
Related to https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md#-breaking-changes
1 parent 2f023ec commit 76c6b50

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Please follow the recommendations outlined at [keepachangelog.com](http://keepac
1818
### [Unreleased]
1919
Changes since the last non-beta release.
2020

21+
#### Fixed
22+
- Fixed css-loader installation with [PR 1634](https://github.com/shakacode/react_on_rails/pull/1634) by [vaukalak](https://github.com/vaukalak)
2123
#### Fixed
2224
- 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)
2325

lib/generators/react_on_rails/base_generator.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ def copy_base_files
4040
def copy_js_bundle_files
4141
base_path = "base/base/"
4242
base_files = %w[app/javascript/packs/server-bundle.js
43-
app/javascript/bundles/HelloWorld/components/HelloWorldServer.js]
43+
app/javascript/bundles/HelloWorld/components/HelloWorldServer.js
44+
app/javascript/bundles/HelloWorld/components/HelloWorld.module.css]
4445
base_files.each { |file| copy_file("#{base_path}#{file}", file) }
4546
end
4647

@@ -91,7 +92,7 @@ def add_yarn_dependencies
9192

9293
puts "Adding CSS handlers"
9394

94-
run "yarn add css-loader css-minimizer-webpack-plugin mini-css-extract-plugin style-loader@"
95+
run "yarn add -D css-loader css-minimizer-webpack-plugin mini-css-extract-plugin style-loader"
9596

9697
puts "Adding dev dependencies"
9798
run "yarn add -D @pmmmwh/react-refresh-webpack-plugin react-refresh"

lib/generators/react_on_rails/templates/base/base/app/javascript/bundles/HelloWorld/components/HelloWorld.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import PropTypes from 'prop-types';
22
import React, { useState } from 'react';
3-
import style from './HelloWorld.module.css';
3+
import * as style from './HelloWorld.module.css';
44

55
const HelloWorld = (props) => {
66
const [name, setName] = useState(props.name);

lib/generators/react_on_rails/templates/redux/base/app/javascript/bundles/HelloWorld/components/HelloWorld.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import PropTypes from 'prop-types';
22
import React from 'react';
3-
import style from './HelloWorld.module.css';
3+
import * as style from './HelloWorld.module.css';
44

55
const HelloWorld = ({ name, updateName }) => (
66
<div>

0 commit comments

Comments
 (0)