Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

210
Views
Setting up actioncable and sockjs-node globally with ESBuild rails 6

The dev team and I have been in the process of moving our current setup from webpack to esbuild. We have some coffeescript files that rely on actioncable. Actioncable has completely stopped since removing webpacker dependencies/webpack-dev-server. Does anyone know how to get actioncable to run at the window level, so that our coffeescript files can access it? We used sockjs-node for our webpack setup and need to get the same results with esbuild.

package.json

{
  "name": "app",
  "private": "true",
  "dependencies": {
    "@rails/actioncable": "^7.0.0"
    "@hotwired/turbo-rails": "^7.0.1",
    "@popperjs/core": "^2.10.2",
    "bootstrap": "^5.1.1",
    "esbuild": "^0.13.3",
    "esbuild-rails": "^1.0.3",
    "sass": "^1.42.1"
  },
  "scripts": {
    "build": "node esbuild.config.js",
    "build:css": "sass ./app/assets/stylesheets/application.bootstrap.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules"
  }
}

esbuild.config.js

const path = require('path')
const rails = require('esbuild-rails')

require("esbuild").build({
    entryPoints: ["application.js"],
    bundle: true,
    outdir: path.join(process.cwd(), "app/assets/builds"),
    absWorkingDir: path.join(process.cwd(), "app/javascript"),
    watch: process.argv.includes("--watch"),
    plugins: [rails()],
}).catch(() => process.exit(1))

application.js

import actioncable from "actioncable"

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!