fix: webpack config exclude statement to system agnostic (#6857)

This commit is contained in:
zsviczian 2023-08-05 11:49:57 +02:00 committed by GitHub
parent 083bcf802c
commit e7983bc493
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 8 deletions

View File

@ -2,8 +2,8 @@ const path = require("path");
const webpack = require("webpack"); const webpack = require("webpack");
const autoprefixer = require("autoprefixer"); const autoprefixer = require("autoprefixer");
const { parseEnvVariables } = require("./env"); const { parseEnvVariables } = require("./env");
const outputDir = process.env.EXAMPLE === "true" ? "example/public" : "dist"; const outputDir = process.env.EXAMPLE === "true" ? "example/public" : "dist";
module.exports = { module.exports = {
mode: "development", mode: "development",
devtool: false, devtool: false,
@ -17,7 +17,6 @@ module.exports = {
filename: "[name].js", filename: "[name].js",
chunkFilename: "excalidraw-assets-dev/[name]-[contenthash].js", chunkFilename: "excalidraw-assets-dev/[name]-[contenthash].js",
assetModuleFilename: "excalidraw-assets-dev/[name][ext]", assetModuleFilename: "excalidraw-assets-dev/[name][ext]",
publicPath: "", publicPath: "",
}, },
resolve: { resolve: {
@ -45,7 +44,7 @@ module.exports = {
{ {
test: /\.(ts|tsx|js|jsx|mjs)$/, test: /\.(ts|tsx|js|jsx|mjs)$/,
exclude: exclude:
/node_modules\/(?!(browser-fs-access|canvas-roundrect-polyfill))/, /node_modules[\\/](?!(browser-fs-access|canvas-roundrect-polyfill))/,
use: [ use: [
{ {
loader: "import-meta-loader", loader: "import-meta-loader",

View File

@ -1,10 +1,10 @@
const path = require("path"); const path = require("path");
const webpack = require("webpack");
const autoprefixer = require("autoprefixer");
const { parseEnvVariables } = require("./env");
const TerserPlugin = require("terser-webpack-plugin"); const TerserPlugin = require("terser-webpack-plugin");
const BundleAnalyzerPlugin = const BundleAnalyzerPlugin =
require("webpack-bundle-analyzer").BundleAnalyzerPlugin; require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
const autoprefixer = require("autoprefixer");
const webpack = require("webpack");
const { parseEnvVariables } = require("./env");
module.exports = { module.exports = {
mode: "production", mode: "production",
@ -47,8 +47,7 @@ module.exports = {
{ {
test: /\.(ts|tsx|js|jsx|mjs)$/, test: /\.(ts|tsx|js|jsx|mjs)$/,
exclude: exclude:
/node_modules\/(?!(browser-fs-access|canvas-roundrect-polyfill))/, /node_modules[\\/](?!(browser-fs-access|canvas-roundrect-polyfill))/,
use: [ use: [
{ {
loader: "import-meta-loader", loader: "import-meta-loader",