Skip to content
This repository has been archived by the owner on Jul 17, 2020. It is now read-only.

Don't explode if child process is already dead #10

Merged
merged 1 commit into from
Sep 25, 2016
Merged

Don't explode if child process is already dead #10

merged 1 commit into from
Sep 25, 2016

Conversation

mikker
Copy link
Contributor

@mikker mikker commented Sep 24, 2016

My brunch watcher is always, always already dead at this point (why? Will we ever know?)

Fixes #5

Thanks!

@rstacruz rstacruz merged commit ab1bf7c into rstacruz:master Sep 25, 2016
@rstacruz
Copy link
Owner

Thanks for this! Would love to know what you think of npm-pipeline-rails and how you're using it.

@rstacruz
Copy link
Owner

1.6.1 is out with this fix, thanks!

@mikker
Copy link
Contributor Author

mikker commented Sep 25, 2016

Great! Glad to help. I'm using it with as many Rails projects as I can. Usually with brunch but I could definitely imagine doing it with Webpack too.

As you say so yourself, the asset pipeline is too old and cumbersome and the web has come far since it was made. Doing even the smallest amount of front-end – JavaScript OR CSS – without access to npm and node_modules gets tedious fast.

I think your lib here does the minimally required setting up to allow maximum customisability. Just as I'd want it to.

@mikker
Copy link
Contributor Author

mikker commented Sep 25, 2016

I sometimes did this along with a Webpack dev server script:

In the bottom of development.rb:

if defined?(Rails::Server)
  class WebpackDevServer
    def self.run!
      return @pid if @pid

      @pid = Process.spawn("./webpack.server.js")
      Signal.trap("EXIT") { Process.kill(9, pid) }

      @pid
    end
  end

  WebpackDevServer.run!
end

Which I suppose is a somewhat brutal way of doing what this gem is doing 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants