Custom patch for [email protected], should work on later version untill iamkun/dayjs#1377 resolved.
Patches resolves compatability issue between dayjs timezone plugin and https://formatjs.io/docs/polyfills
| module.exports.parser = 'tsx'; | |
| module.exports = function transformer(file, api, options) { | |
| const j = api.jscodeshift; | |
| const root = j(file.source); | |
| const { from: fromPath, to: toPath } = options; | |
| const jestLookFor = ["mock", "doMock"]; | |
| replaceImports(); | 
Custom patch for [email protected], should work on later version untill iamkun/dayjs#1377 resolved.
Patches resolves compatability issue between dayjs timezone plugin and https://formatjs.io/docs/polyfills
one line
(function () {
    var cookies = document.cookie.split("; ");
    for (var c = 0; c < cookies.length; c++) {
        var d = window.location.hostname.split(".");
        while (d.length > 0) {
            var cookieBase = encodeURIComponent(cookies[c].split(";")[0].split("=")[0]) + '=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain=' + d.join('.') + ' ;path=';
            var p = location.pathname.split('/');| const path = require('path') | |
| const fs = require('fs') | |
| class LoadablePlugin { | |
| constructor({ filename = 'loadable-stats.json', writeToDisk = false } = {}) { | |
| this.opts = { filename, writeToDisk } | |
| } | |
| gather = (hookCompiler, callback) => { | |
| const stats = hookCompiler.getStats().toJson({ | 
| /** | |
| `useChangeLog` - dev-mode helper hook to let you | |
| know why a memoized component re-rendered! | |
| Usage example: | |
| const YourComponent = React.memo((props) => { | |
| // Just drop this fella into your memo component's body. | |
| useChangeLog(props); | 
| class LazyImage extends PureComponent { | |
| static defaultProps = { | |
| engage: false, | |
| }; | |
| state = { | |
| initialEngage: false, | |
| }; | |
| componentWillMount() { | 
| const fs = require('fs'); | |
| const path = require('path'); | |
| const loadJsonFile = require('load-json-file'); | |
| const dotNext = path.resolve(__dirname, '.next'); | |
| const stats = loadJsonFile.sync(`${dotNext}/build-stats.json`); | |
| const buildId = fs.readFileSync(`${dotNext}/BUILD_ID`, 'utf8'); |