Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

222
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda