Skip to content

Commit

Permalink
adds mjs loader to webpack to support Node 20
Browse files Browse the repository at this point in the history
  • Loading branch information
davelandry committed May 29, 2024
1 parent d09503a commit abd7712
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/core/src/client.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import React from "react";
import {hydrate} from "react-dom";
import {loadableReady} from "@loadable/component";
import {createHistory} from "history";
import {HelmetProvider} from "react-helmet-async";
import {applyRouterMiddleware, Router, RouterContext, useRouterHistory} from "react-router";
Expand Down Expand Up @@ -132,10 +131,10 @@ function renderMiddleware() {
const chunks = props.components.filter(comp => comp && comp.preload && comp.load);
const {action, hash, pathname, query, search, state} = location;

//Launch Optimize activation event if client side navigation
// Launch Optimize activation event if client side navigation
function launchOptimizeEvent() {
if (CANON_GOOGLE_OPTIMIZE && !window.__SSR__ && window.dataLayer) {
window.dataLayer.push({'event': 'optimize.activate'});
window.dataLayer.push({event: "optimize.activate"});
}
}

Expand Down
5 changes: 5 additions & 0 deletions packages/core/webpack/config/loaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ function commonLoaders(props) {
alias.$app = path.join(rootDir, "app");

return [
{
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto"
},
{
resolve: {
alias
Expand Down

0 comments on commit abd7712

Please sign in to comment.