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
This commit is contained in:
@@ -21,7 +21,7 @@ const removeCSSImports = {
|
|||||||
async function build() {
|
async function build() {
|
||||||
// Bundle only the .scss files into a single css file
|
// Bundle only the .scss files into a single css file
|
||||||
await esbuild.build({
|
await esbuild.build({
|
||||||
entryPoints: ['src/exports/client/index.ts'],
|
entryPoints: ['src/exports/cssEntry.ts'],
|
||||||
bundle: true,
|
bundle: true,
|
||||||
minify: true,
|
minify: true,
|
||||||
outdir: 'dist/bundled_scss',
|
outdir: 'dist/bundled_scss',
|
||||||
@@ -35,7 +35,7 @@ async function build() {
|
|||||||
fs.mkdirSync('dist/exports/client_optimized')
|
fs.mkdirSync('dist/exports/client_optimized')
|
||||||
|
|
||||||
try {
|
try {
|
||||||
fs.renameSync('dist/bundled_scss/index.css', 'dist/field/bundled.css')
|
fs.renameSync('dist/bundled_scss/cssEntry.css', 'dist/field/bundled.css')
|
||||||
fs.copyFileSync('dist/field/bundled.css', 'dist/exports/client_optimized/bundled.css')
|
fs.copyFileSync('dist/field/bundled.css', 'dist/exports/client_optimized/bundled.css')
|
||||||
fs.rmSync('dist/bundled_scss', { recursive: true })
|
fs.rmSync('dist/bundled_scss', { recursive: true })
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ const { rules } = reactCompiler
|
|||||||
export const index = [
|
export const index = [
|
||||||
...rootEslintConfig,
|
...rootEslintConfig,
|
||||||
{
|
{
|
||||||
|
ignores: ['bundle.js'],
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
...rootParserOptions,
|
...rootParserOptions,
|
||||||
|
|||||||
5
packages/richtext-lexical/src/exports/cssEntry.ts
Normal file
5
packages/richtext-lexical/src/exports/cssEntry.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
// The purpose of this file is to export all modules that may contain SCSS.
|
||||||
|
// These will then be bundled into one CSS file by our bundler.
|
||||||
|
|
||||||
|
export * from './client/index.js'
|
||||||
|
export * from './server/rsc.js'
|
||||||
@@ -7,6 +7,7 @@ import React from 'react'
|
|||||||
|
|
||||||
import './htmlDiff/index.scss'
|
import './htmlDiff/index.scss'
|
||||||
import './index.scss'
|
import './index.scss'
|
||||||
|
import '../bundled.css'
|
||||||
|
|
||||||
import type { HTMLConvertersFunctionAsync } from '../../features/converters/lexicalToHtml/async/types.js'
|
import type { HTMLConvertersFunctionAsync } from '../../features/converters/lexicalToHtml/async/types.js'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user