Reputation: 4810
I'm looking to use Requirejs (v2.1.8) to create a source map of my minified/optimized project.
I've been able to successfully do this by adding the following variables to my build file:
However, this creates a map and source file for every single JS file that makes up my application. What i am looking to do is to use Requirejs to combine all my JS source files into a single file (without optimising) and then to optimise this resulting file and to create a source map for it.
This will therefore leave me with three files:
I understand that support for source maps in Requirejs is in the experimental stage. I was wondering if anybody knew of a option to tell the compiler to do what i've described above?
If not, does anybody know how to use the Requirejs compiler to optimise a single JS file (which has already been built using Requirejs but with the optimize setting set to none) which also creates a source map at the same time?
Upvotes: 1
Views: 482
Reputation: 4810
It seems that i have misunderstood what requirejs does when it optimizes and creates source maps.
It turns out requirejs creates a map and source file for every single JS file in your project as well as a source map for the optimized JS file (typically called main.js). If you're only after a source map for the main.js file then you can delete all the others.
Hope this helps somebody else!
Upvotes: 1