Brainmaniac's avatar

Laravel mix produced different result on Mac/Ubuntu :|

Noticed a strange bug which only ocured when Mac bundles my JS. So I made Ubuntu VM to compare what is happening.

  • index.js (the bundled output) on Mac is 128008 rows VS on ubuntu only 104808.
  • Using Laravel mix dump() I see the webpack.mix resulting config files are identical between mac/ubuntu (only paths differ)
  • Running 'yarn development' or 'yarn watch' does not matter. Package.json scripts appends NODE_ENV=development (on any OS)
  • Examining other ENV on my mac reveals nothing out of the ordinary
  • uninstalled global tsc on mac for possible conflict

Tried multiple versions, currently running

yarn --version 1.22.10 tsc --version Version 4.0.2 node --version v14.15.1

webpack.mix.js

const mix = require('laravel-mix');
const tailwindcss = require('tailwindcss');

mix.ts('src/index.tsx', 'dist/js').react()

tsconfig

{
  "compilerOptions": {
    "module": "esnext",
    "target": "esnext",
    "esModuleInterop": true,
    "moduleResolution": "node",
    "removeComments": true,
    "preserveConstEnums": true,
    "sourceMap": true,
    "resolveJsonModule": true,
    "experimentalDecorators": true,
    "allowJs": true,
    "checkJs": false,
    "jsx": "react",
    "lib": ["es2019", "dom"]
  }
}

Package json scripts

  "scripts": {
    "format": "prettier --write \"./**/*.(js|ts|json|md|css|less|scss)\"",
    "lint": "eslint src --ext .js,.ts",
    "lint:fix": "eslint src --fix --ext .js,.ts",
    "lint:quiet:fix": "eslint src --quiet --fix --ext .js,.ts",
    "dev": "npm run development",
    "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch": "npm run development -- --watch",
    "watch-poll": "mix watch -- --watch-options-poll=1000",
    "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --disable-host-check --config=node_modules/laravel-mix/setup/webpack.config.js",
    "prod": "npm run production",
    "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --config=node_modules/laravel-mix/setup/webpack.config.js",
    "test": "jest --testPathIgnorePatterns=.*e2e.test.*",
    "test:e2e": "jest --passWithNoTests --detectOpenHandles -c jest.e2e.config.js"
  },

Out of things to try. Tried looking into the actual output diff but not sure what to look for there. Thankful for any ideas.

0 likes
0 replies

Please or to participate in this conversation.