Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Use rake:build

Both mozilla source-map and uglify provide in-browser versions, but
don't work easily with stitch, so we just use the in-browser versions.
  • Loading branch information...
commit fbfc1f14dd5a317060a1470828e9e4f2f9c21f7b 1 parent bff5f8f
Conrad Irwin ConradIrwin authored

Showing 5 changed files with 1,254 additions and 4,801 deletions. Show diff stats Hide diff stats

  1. +1 3 README.md
  2. +22 0 Rakefile
  3. +0 23 build.js
  4. +1,231 4,774 lib/uglify.js
  5. +0 1  uglifier.gemspec
4 README.md
Source Rendered
@@ -54,9 +54,7 @@ Available options and their defaults are
54 54
55 55 ## Development
56 56
57   -Uglifier uses [stitch](https://github.com/sstephenson/stitch) to compile UglifyJs for non-node JS runtimes. If you need to update or patch UglifyJS, you can stitch UglifyJS using
58   -
59   - node build.js
  57 +Uglifier bundles its javascript dependencies using git submodules. If you want to rebuild the javascript you will first need to get the latest version of the code with `git submodule update --init`. After you have the git submodules at the desired versions, run `rake js` to recreate `lib/uglify.js`.
60 58
61 59 See [CONTRIBUTING](https://github.com/lautis/uglifier/blob/master/CONTRIBUTING.md) for details about contributing to Uglifier.
62 60
22 Rakefile
@@ -37,3 +37,25 @@ Rake::RDocTask.new do |rdoc|
37 37 rdoc.rdoc_files.include('README*')
38 38 rdoc.rdoc_files.include('lib/**/*.rb')
39 39 end
  40 +
  41 +desc "Rebuild lib/uglify.js"
  42 +task :js do
  43 +
  44 + cd 'vendor/source-map/' do
  45 + `npm install`
  46 + `node Makefile.dryice.js`
  47 + end
  48 +
  49 + cd 'vendor/uglifyjs/' do
  50 + # required to run ./uglifyjs2 --self; not bundled.
  51 + `npm install`
  52 + end
  53 +
  54 + source = ""
  55 + source << "window = this;"
  56 + source << File.read("vendor/source-map/dist/source-map.js")
  57 + source << "MOZ_SourceMap = sourceMap;"
  58 + source << `./vendor/uglifyjs/bin/uglifyjs2 --self`
  59 +
  60 + File.write("lib/uglify.js", source)
  61 +end
23 build.js
... ... @@ -1,23 +0,0 @@
1   -#!/usr/bin/env node
2   -
3   -var fs = require("fs");
4   -var stitch = require("stitch");
5   -
6   -var package = stitch.createPackage({
7   - paths: [__dirname + "/vendor/uglifyjs/lib"]
8   -});
9   -
10   -package.compile(function(err, source) {
11   - if (err) throw err;
12   -
13   - source = "(function(global) {" +
14   - source + ";\n" +
15   - "global.UglifyJS = {};\n" +
16   - "global.UglifyJS.parser = this.require('parse-js');\n" +
17   - "global.UglifyJS.uglify = this.require('process');\n" +
18   - "}).call({}, this);\n";
19   -
20   - fs.writeFile(__dirname + "/lib/uglify.js", source, function(err) {
21   - if (err) throw err;
22   - });
23   -});
6,005 lib/uglify.js
1,231 additions, 4,774 deletions not shown
1  uglifier.gemspec
@@ -25,7 +25,6 @@ Gem::Specification.new do |s|
25 25 "README.md",
26 26 "Rakefile",
27 27 "VERSION",
28   - "build.js",
29 28 "lib/es5.js",
30 29 "lib/uglifier.rb",
31 30 "lib/uglify.js",

0 comments on commit fbfc1f1

Please sign in to comment.
Something went wrong with that request. Please try again.