Skip to content

Instantly share code, notes, and snippets.

@conartist6
Last active July 14, 2020 20:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save conartist6/2eab39097acbcda7450c9538cbdd0768 to your computer and use it in GitHub Desktop.
Save conartist6/2eab39097acbcda7450c9538cbdd0768 to your computer and use it in GitHub Desktop.
Built webpackable component example
/* @macrome
* @generated-by ./index.js
*/
const React = require('react');
const styles = require('index.module.css.js');
require('index.module.css');
// The bundler needs a css require to exist for static analysis.
// Node require hooks may be used to make requiring any .css a no-op.
function MyComponent(props) {
return React.createElement(
'button',
{ className: styles.button }
' Push me '
);
}
module.exports = { MyComponent };
/* @macrome
* @generated-by ./index.module.scss
*/
._button_116zl_1 {
line-height: 2;
}
/* @macrome
* @generated-by ./index.module.scss
*/
module.exports = {
button: "_button_116zl_1"
};
.button {
line-height: 2;
}
import * as React from 'react';
import styles from 'index.module.scss';
export function MyComponent(props) {
return <button className={styles.button}> Push me </button>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment