Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Expo example app to enable static CSS extraction #238

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"react-native-web": "~0.19.13"
},
"devDependencies": {
"@babel/core": "^7.25.2"
"@babel/core": "^7.25.2",
"autoprefixer": "^10.4.20",
"postcss-react-strict-dom": "0.0.2"
}
}
11 changes: 11 additions & 0 deletions apps/examples/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
plugins: {
'postcss-react-strict-dom': {
include: [
'src/**/*.{js,jsx,ts,tsx}',
'../../packages/react-strict-dom/dist/**/*.{js,jsx,ts,tsx}'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used require.resolve('react-strict-dom') in #239.
See javascripter/postcss-react-strict-dom#3

]
},
autoprefixer: {}
}
};
2 changes: 2 additions & 0 deletions apps/examples/src/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* This placeholder file is required for postcss-react-strict-dom */
@stylex;
3 changes: 3 additions & 0 deletions apps/examples/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
* LICENSE file in the root directory of this source tree.
*/

import '@expo/metro-runtime'; // Required for Fast Refresh to work on Expo Web
import { LogBox } from 'react-native';

import { registerRootComponent } from 'expo';

import App from './App';

import './global.css';

if (LogBox != null) {
LogBox.ignoreLogs([
// /React Strict DOM: .*/,
Expand Down
Loading
Loading