Open ehteshamkafeel opened 9 years ago
@ehteshamkafeel it depends on your workflow, if you build a single file with almond.js or if you still use require.js. This was long debated before. Not sure for know what to do.
+1
Hi,
I have a problem related with this. I want to know how to handle properly the scenario of multipage: https://github.com/requirejs/example-multipage
I have a common module for several pages and page-specific modules for each one. I want to keep the common module because I'll get the benefit of browser caching for an assets that it's repeated in a lot of pages.
AFAIK, the recommendation of using almod it will put all the files in one single file, but in that case I won't get the previous benefit that I mentioned. Does anyone know a properly way to handle this case?
Thanks! Viko
The latest changes in
usemin
has stopped the support for require.js blocks as they are being processed by requirejs task. This has introduced errors in generators, e.g.generator-backbone
still using conditional blocks forrequire.js
JS file.If the block is removed from source file, all works fine except that in dist version of html script declaration doesn't get replaced by dest and revved file. i.e.
<script data-main="path/to/main" src-"path/to/requirejs">
from source folder remain as it it is in dist.I think in this case usemin should still process the block to replace file dest and revved version. I don't know what the proper fix is but If you just remove the line
throw new Error('require.js blocks are no more supported.');
infile.js
it works as expected.