Skip to content

Commit f1d9b44

Browse files
authored
fix(richtext-lexical): diff component css was not included in css bundle (#12028)
Currently, the lexical version diff component is completely unstyled, as the scss was never included in our css bundle. This PR ensures that the diff component scss is included in our css bundle
1 parent 09916ad commit f1d9b44

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

packages/richtext-lexical/bundle.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const removeCSSImports = {
2121
async function build() {
2222
// Bundle only the .scss files into a single css file
2323
await esbuild.build({
24-
entryPoints: ['src/exports/client/index.ts'],
24+
entryPoints: ['src/exports/cssEntry.ts'],
2525
bundle: true,
2626
minify: true,
2727
outdir: 'dist/bundled_scss',
@@ -35,7 +35,7 @@ async function build() {
3535
fs.mkdirSync('dist/exports/client_optimized')
3636

3737
try {
38-
fs.renameSync('dist/bundled_scss/index.css', 'dist/field/bundled.css')
38+
fs.renameSync('dist/bundled_scss/cssEntry.css', 'dist/field/bundled.css')
3939
fs.copyFileSync('dist/field/bundled.css', 'dist/exports/client_optimized/bundled.css')
4040
fs.rmSync('dist/bundled_scss', { recursive: true })
4141
} catch (err) {

packages/richtext-lexical/eslint.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const { rules } = reactCompiler
99
export const index = [
1010
...rootEslintConfig,
1111
{
12+
ignores: ['bundle.js'],
1213
languageOptions: {
1314
parserOptions: {
1415
...rootParserOptions,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// The purpose of this file is to export all modules that may contain SCSS.
2+
// These will then be bundled into one CSS file by our bundler.
3+
4+
export * from './client/index.js'
5+
export * from './server/rsc.js'

packages/richtext-lexical/src/field/Diff/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import React from 'react'
77

88
import './htmlDiff/index.scss'
99
import './index.scss'
10+
import '../bundled.css'
1011

1112
import type { HTMLConvertersFunctionAsync } from '../../features/converters/lexicalToHtml/async/types.js'
1213

0 commit comments

Comments
 (0)