Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
@ConradIrwin ConradIrwin authored
Showing with 1,254 additions and 4,801 deletions.
  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
View
4 README.md
@@ -54,9 +54,7 @@ Available options and their defaults are
## Development
-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
-
- node build.js
+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`.
See [CONTRIBUTING](https://github.com/lautis/uglifier/blob/master/CONTRIBUTING.md) for details about contributing to Uglifier.
View
22 Rakefile
@@ -37,3 +37,25 @@ Rake::RDocTask.new do |rdoc|
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
+
+desc "Rebuild lib/uglify.js"
+task :js do
+
+ cd 'vendor/source-map/' do
+ `npm install`
+ `node Makefile.dryice.js`
+ end
+
+ cd 'vendor/uglifyjs/' do
+ # required to run ./uglifyjs2 --self; not bundled.
+ `npm install`
+ end
+
+ source = ""
+ source << "window = this;"
+ source << File.read("vendor/source-map/dist/source-map.js")
+ source << "MOZ_SourceMap = sourceMap;"
+ source << `./vendor/uglifyjs/bin/uglifyjs2 --self`
+
+ File.write("lib/uglify.js", source)
+end
View
23 build.js
@@ -1,23 +0,0 @@
-#!/usr/bin/env node
-
-var fs = require("fs");
-var stitch = require("stitch");
-
-var package = stitch.createPackage({
- paths: [__dirname + "/vendor/uglifyjs/lib"]
-});
-
-package.compile(function(err, source) {
- if (err) throw err;
-
- source = "(function(global) {" +
- source + ";\n" +
- "global.UglifyJS = {};\n" +
- "global.UglifyJS.parser = this.require('parse-js');\n" +
- "global.UglifyJS.uglify = this.require('process');\n" +
- "}).call({}, this);\n";
-
- fs.writeFile(__dirname + "/lib/uglify.js", source, function(err) {
- if (err) throw err;
- });
-});
View
6,005 lib/uglify.js
1,231 additions, 4,774 deletions not shown
View
1  uglifier.gemspec
@@ -25,7 +25,6 @@ Gem::Specification.new do |s|
"README.md",
"Rakefile",
"VERSION",
- "build.js",
"lib/es5.js",
"lib/uglifier.rb",
"lib/uglify.js",

0 comments on commit fbfc1f1

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