diff --git a/webpack.config.ts b/webpack.config.ts index 3b836cc..b60ac50 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -12,6 +12,9 @@ interface FindReplacePluginOptions { replace: { from: RegExp; to: string }[]; } +/** + * Simple find and replace in assets plugin for Webpack + */ class FindReplacePlugin { options: FindReplacePluginOptions; @@ -65,14 +68,12 @@ class FindReplacePlugin { } const babelRule: RuleSetRule = { - test: /\.(ts|js)$/, + test: /\.(ts|js|mjs)$/, // https://webpack.js.org/loaders/babel-loader/#exclude-libraries-that-should-not-be-transpiled - exclude: /node_modules/, - // exclude: [ - // // \\ for Windows, / for macOS and Linux - // /node_modules[\\/]core-js/, - // /node_modules[\\/]webpack[\\/]buildin/, - // ], + exclude: [ + // \\ for Windows, / for macOS and Linux + /node_modules[\\/]core-js/, + ], use: { loader: "babel-loader", options: { @@ -147,7 +148,7 @@ const config: Configuration = { */ { from: /\[\^\\s\(\/\]/g, to: "[^\\s(\\/]" }, { from: /\[\\w\.\/\]/g, to: "[\\w.\\/]" }, - // [a-z_+-\/] + { from: /\[a-z_\+-\/\]/g, to: "[a-z_+-\\/]" }, ], }), ],