Comments (5)
I seem to recall that being normal. I realize that's probably not the answer you were hoping.
from browserify-rails.
Hey thanks for the reply. It's good just to know it's normal and that there's no way around it right now. I wonder if it would even be feasible to check the cache on startup? Maybe something I'll look into contributing myself if I can. Right now one of our apps spends about 2 minutes browserifying everything every time we restart the dev server, which can be pretty annoying.
from browserify-rails.
I'm on really shaky ground here as it has been a while since I looked into that part of the code and debugged it but...
I think the issue is that the browsery-incremental cache is put in a temporary directory related to the assets pipeline. So it's not hard coded to an external directory. And I think that temporary directory name/path changes on restart. So what you might look to do is to make an option to set browserify-incremental, if it supports it, to always put the cache in a given directory. Or do some magic around stop and restart to somehow persist the cache. That might get you what you want?
from browserify-rails.
I had to look, so browserify-incremental has a cache_file_path
parameter and we are indeed setting that:
cache_file_path = rails_path(tmp_path, "browserifyinc-cache.json")
command_options << " --cachefile=#{Shellwords.escape(cache_file_path)}"
So one could indeed add a configuration option with an external path (perhaps called persistent cache directory or something like that) and if that is set, use that. I'd suggest starting by examining the paths that are in use now for the cache -- I seem to recall while it looks like from the code they might be reasonable, that there was some server-start-random-value in it that would cause the symptoms you're describing (of not persisting between restarts).
from browserify-rails.
We’re experiencing this as well, after having upgraded sprockets from 3.7.2 to 4.0.0. Everything gets compiled again and again.
from browserify-rails.
Related Issues (20)
- Problem with transpilation of Javascript inside an Engine HOT 2
- EPERM with browserify on Windows, succeeds with browserify-incremental HOT 1
- Wrong lookup path HOT 6
- Require throwing error in rails HOT 1
- Browserify copies modules multiple times HOT 2
- Browserify not doing anything when precompiling assets HOT 1
- not compiling on production after update to browserify 14.3.0 HOT 9
- What's the advantage of using this gem over rails' new webpacker gem? HOT 5
- Browserify breaks action cable HOT 3
- Production env. randomly not compiling certain .js files HOT 2
- Babel Documentation
- Error requiring .coffee files from a node_module HOT 2
- Encoding::UndefinedConversionError occurs when js file contains Chinese characters HOT 2
- Accessing code outside browserified code HOT 4
- Browserify Rails is skipping a file.
- Browserify-rails is not passing process.env.NODE_ENV to the assets? HOT 1
- Problem when try require module in my html.erb file into script tags HOT 4
- ES6 code with no imports HOT 7
- Rails 5.2 support HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from browserify-rails.