Skip to content

Commit

Permalink
update setup
Browse files Browse the repository at this point in the history
  • Loading branch information
atarashansky committed Dec 12, 2024
1 parent ddce646 commit fbad80e
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 7 deletions.
5 changes: 0 additions & 5 deletions client/__tests__/e2e/playwright.global.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ const setup = async ({ page }: { page: Page }) => {
* Use Case: Useful for detecting and debugging runtime errors in the web page's JavaScript
*/
page.on("pageerror", (error) => {
// Hack: Always ignore "exports is not defined" error regardless of environment
// TODO: Fix the underlying issue
if (error.toString().includes("exports is not defined")) {
return;
}
// if this is running locally don't fail on error
if (process.env.CI !== "true") {
return;
Expand Down
2 changes: 1 addition & 1 deletion client/configuration/babel/babel.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
{
useBuiltIns: "entry",
corejs: 3,
modules: false,
modules: "auto",
},
],
"@babel/preset-react",
Expand Down
2 changes: 1 addition & 1 deletion client/configuration/babel/babel.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
{
useBuiltIns: "entry",
corejs: 3,
modules: false,
modules: "auto",
},
],
"@babel/preset-react",
Expand Down
38 changes: 38 additions & 0 deletions client/configuration/webpack/webpack.config.shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,33 @@ module.exports = {
"abort-controller/polyfill",
"./src/index",
],
externals: {
"react-draggable": {
commonjs: "react-draggable",
commonjs2: "react-draggable",
amd: "react-draggable",
root: "ReactDraggable",
},
},
output: {
path: path.resolve("build"),
publicPath,
library: {
type: "umd",
umdNamedDefine: true,
},
globalObject: "typeof self !== 'undefined' ? self : this",
},
resolve: {
extensions: [".ts", ".tsx", ".js", ".jsx", "..."],
modules: [path.resolve(__dirname, "../../src"), "node_modules"],
alias: {
"~/globals": path.resolve(__dirname, "../../src/globals"),
},
fallback: {
path: false,
fs: false,
},
},
module: {
rules: [
Expand Down Expand Up @@ -69,6 +86,27 @@ module.exports = {
loader: "json-loader",
exclude: /manifest.json$/,
},
{
test: /\.m?js/,
resolve: {
fullySpecified: false,
},
},
{
test: /\.(js|jsx|ts|tsx)$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
options: {
presets: [
"@babel/preset-env",
"@babel/preset-react",
"@babel/preset-typescript",
],
plugins: ["@babel/plugin-transform-runtime"],
},
},
},
],
},
plugins: [
Expand Down

0 comments on commit fbad80e

Please sign in to comment.