This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// razzle.config.js | |
'use strict'; | |
module.exports = { | |
modifyWebpackOptions({ | |
options: { | |
webpackOptions, // the modified options that was used to configure webpack/ webpack loaders and plugins | |
} | |
}) { | |
webpackOptions.babelRule.include = webpackOptions.babelRule.include.concat([ | |
/grommet/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = (rules, loaderName) => { | |
// i.e.: /eslint-loader/ | |
const loaderRegex = new RegExp(`[/\\\\]${loaderName}[/\\\\]`); | |
return rules.reduce((info, rule, ruleIndex) => { | |
if (rule.use) { | |
// Checks if there is an object inside rule.use with loader matching loaderRegex, OR | |
// Checks another condition, if rule is not an object, but pure string (ex: "style-loader", etc) | |
const useIndex = (typeof rule.use === 'function' ? rule.use({}) : rule.use).findIndex( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
// https://github.com/storybookjs/storybook/issues/14342 | |
// https://webpack.js.org/contribute/plugin-patterns/#monitoring-the-watch-graph | |
/** | |
* Logs the last changed files during webpack rebuilds. | |
*/ | |
class WebpackLastFilesLoggerPlugin { | |
constructor() { | |
this.startTime = Date.now(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { Formik } from "formik"; | |
const BasicExample = () => { | |
const buttonRef = useRef(); | |
return ( | |
<div> | |
<h1>My Form</h1> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import logo from './react.svg'; | |
import './Home.css'; | |
import { Helmet} from 'react-helmet-async'; | |
import axios from 'axios'; | |
class Home extends React.Component { | |
my_title = 'sss' | |
constructor(props) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat << EOF | python3 | |
import re | |
import requests | |
import json | |
# Regular expression to match Rust use statements | |
regex = r"use ([^;]+);" | |
# Rust source code as a multiline string |
OlderNewer