Skip to content

Instantly share code, notes, and snippets.

@conartist6
Last active July 14, 2020 20:12
Embed
What would you like to do?
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