Skip to content

Instantly share code, notes, and snippets.

@hw0k
Created April 9, 2020 07:17
Show Gist options
  • Save hw0k/c7672789c110b73134043b4588cbdbbf to your computer and use it in GitHub Desktop.
Save hw0k/c7672789c110b73134043b4588cbdbbf to your computer and use it in GitHub Desktop.
RNSW 2
import { configure } from '@storybook/react';
configure(require.context('../src', true, /\.stories\.js?$/), module);
<meta
name="viewport"
content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no"
/>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500"
/>
<style>
html,
body {
padding: 0;
margin: 0;
}
#root {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
}
</style>
const path = require('path');
module.exports = ({ config }) => {
config.module.rules.push({
test: /\.js?$/,
include: [
path.resolve(__dirname, '../node_modules/react-native'),
],
use: [
{
loader: 'babel-loader',
options: {
presets: [
'module:metro-react-native-babel-preset',
],
plugins: [
['react-native-web', { commonjs: true }],
],
},
},
],
});
config.resolve.alias['react-native$'] = 'react-native-web';
config.resolve.extensions = ['.web.js', '.js', '.jsx'];
return config;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment