Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion examples/src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import React from "react";
import ReactDOM from "react-dom";
import sdk from "@gooddata/gooddata-js";
import "@babel/polyfill";

import { Router, Route, Redirect, Switch } from "react-router-dom";
import { createBrowserHistory } from "history";
Expand Down
28 changes: 22 additions & 6 deletions examples/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ module.exports = async (env, argv) => {
}

return {
entry: ["./src/index.jsx"],
entry: ["@babel/polyfill", "./src/index.jsx"],
plugins,
output: {
filename: "[name].[hash].js",
Expand All @@ -108,7 +108,8 @@ module.exports = async (env, argv) => {
__filename: true,
},
resolve: {
mainFields: ["browser", "main", "module"],
// Prefer ESM versions of packages to enable tree shaking and easier dev experience
mainFields: ["module", "browser", "main"],
extensions: [".js", ".jsx"],
alias: {
"@gooddata/react-components/styles": path.resolve(__dirname, "../styles/"),
Expand All @@ -126,12 +127,27 @@ module.exports = async (env, argv) => {
loaders: ["style-loader", "css-loader", "sass-loader"],
},
{
test: /\.jsx?$/,
// we have to explicitly transpile react-intl for it to work in IE11
// see docs https://github.com/formatjs/react-intl/blob/master/docs/Getting-Started.md#webpack
exclude: /update-dependencies|node_modules\/(?!react-intl|intl-messageformat|intl-messageformat-parser)/,
test: /\.[jt]sx?$/,
exclude: /node_modules|update-dependencies/,
loaders: ["babel-loader"],
},
{
test: /\.js?$/,
include: rawModulePath => {
// Some npm modules no longer transpiled to ES5, which
// causes errors such in IE11.
const inclusionReg = /node_modules\/.*((lru-cache)|(react-intl)|(intl-messageformat)|(yup)|highlight.js)/;
// On Windows, mPath use backslashes for folder separators. We need
// to convert these to forward slashes because our
// test regex, inclusionReg, contains one.
const modulePath = rawModulePath.replace(/\\/g, "/");
return inclusionReg.test(modulePath);
},
use: {
loader: "babel-loader",
options: {
presets: ["@babel/preset-env"],
},
},
},
{
Expand Down
5 changes: 3 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6140,8 +6140,9 @@ dns-equal@^1.0.0:
resolved "https://registry.yarnpkg.com/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d"

dns-packet@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-1.3.1.tgz#12aa426981075be500b910eedcd0b47dd7deda5a"
version "1.3.4"
resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-1.3.4.tgz#e3455065824a2507ba886c55a89963bb107dec6f"
integrity sha512-BQ6F4vycLXBvdrJZ6S3gZewt6rcrks9KBgM9vrhW+knGRqc8uEdT7fuCwloc7nny5xNoMJ17HGH0R/6fpo8ECA==
dependencies:
ip "^1.1.0"
safe-buffer "^5.0.1"
Expand Down