mirror of
https://gitlab.com/octtspacc/staticoso
synced 2025-06-05 22:09:23 +02:00
Transition to monorepo on a new Dev branch
This commit is contained in:
14
App/Source/node_modules/uglify-to-browserify/.npmignore
generated
vendored
Normal file
14
App/Source/node_modules/uglify-to-browserify/.npmignore
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
lib-cov
|
||||
*.seed
|
||||
*.log
|
||||
*.csv
|
||||
*.dat
|
||||
*.out
|
||||
*.pid
|
||||
*.gz
|
||||
pids
|
||||
logs
|
||||
results
|
||||
npm-debug.log
|
||||
node_modules
|
||||
/test/output.js
|
3
App/Source/node_modules/uglify-to-browserify/.travis.yml
generated
vendored
Normal file
3
App/Source/node_modules/uglify-to-browserify/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.10"
|
19
App/Source/node_modules/uglify-to-browserify/LICENSE
generated
vendored
Normal file
19
App/Source/node_modules/uglify-to-browserify/LICENSE
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
Copyright (c) 2013 Forbes Lindesay
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
49
App/Source/node_modules/uglify-to-browserify/index.js
generated
vendored
Normal file
49
App/Source/node_modules/uglify-to-browserify/index.js
generated
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
'use strict'
|
||||
|
||||
var fs = require('fs')
|
||||
var PassThrough = require('stream').PassThrough
|
||||
var Transform = require('stream').Transform
|
||||
|
||||
if (typeof Transform === 'undefined') {
|
||||
throw new Error('UglifyJS only supports browserify when using node >= 0.10.x')
|
||||
}
|
||||
|
||||
var cache = {}
|
||||
module.exports = transform
|
||||
function transform(file) {
|
||||
if (!/tools\/node\.js$/.test(file.replace(/\\/g,'/'))) return new PassThrough();
|
||||
if (cache[file]) return makeStream(cache[file])
|
||||
var uglify = require(file)
|
||||
var src = 'var sys = require("util");\nvar MOZ_SourceMap = require("source-map");\nvar UglifyJS = exports;\n' + uglify.FILES.map(function (path) { return fs.readFileSync(path, 'utf8') }).join('\n')
|
||||
|
||||
var ast = uglify.parse(src)
|
||||
ast.figure_out_scope()
|
||||
|
||||
var variables = ast.variables
|
||||
.map(function (node, name) {
|
||||
return name
|
||||
})
|
||||
|
||||
src += '\n\n' + variables.map(function (v) { return 'exports.' + v + ' = ' + v + ';' }).join('\n') + '\n\n'
|
||||
|
||||
src += 'exports.AST_Node.warn_function = function (txt) { if (typeof console != "undefined" && typeof console.warn === "function") console.warn(txt) }\n\n'
|
||||
|
||||
src += 'exports.minify = ' + uglify.minify.toString() + ';\n\n'
|
||||
src += 'exports.describe_ast = ' + uglify.describe_ast.toString() + ';'
|
||||
|
||||
// TODO: remove once https://github.com/substack/node-browserify/issues/631 is resolved
|
||||
src = src.replace(/"for"/g, '"fo" + "r"')
|
||||
|
||||
cache[file] = src
|
||||
return makeStream(src);
|
||||
}
|
||||
|
||||
function makeStream(src) {
|
||||
var res = new Transform();
|
||||
res._transform = function (chunk, encoding, callback) { callback() }
|
||||
res._flush = function (callback) {
|
||||
res.push(src)
|
||||
callback()
|
||||
}
|
||||
return res;
|
||||
}
|
20
App/Source/node_modules/uglify-to-browserify/package.json
generated
vendored
Normal file
20
App/Source/node_modules/uglify-to-browserify/package.json
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "uglify-to-browserify",
|
||||
"version": "1.0.2",
|
||||
"description": "A transform to make UglifyJS work in browserify.",
|
||||
"keywords": [],
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"uglify-js": "~2.4.0",
|
||||
"source-map": "~0.1.27"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test/index.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ForbesLindesay/uglify-to-browserify.git"
|
||||
},
|
||||
"author": "ForbesLindesay",
|
||||
"license": "MIT"
|
||||
}
|
22
App/Source/node_modules/uglify-to-browserify/test/index.js
generated
vendored
Normal file
22
App/Source/node_modules/uglify-to-browserify/test/index.js
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
var fs = require('fs')
|
||||
var br = require('../')
|
||||
var test = fs.readFileSync(require.resolve('uglify-js/test/run-tests.js'), 'utf8')
|
||||
.replace(/^#.*\n/, '')
|
||||
|
||||
var transform = br(require.resolve('uglify-js'))
|
||||
transform.pipe(fs.createWriteStream(__dirname + '/output.js'))
|
||||
.on('close', function () {
|
||||
Function('module,require', test)({
|
||||
filename: require.resolve('uglify-js/test/run-tests.js')
|
||||
},
|
||||
function (name) {
|
||||
if (name === '../tools/node') {
|
||||
return require('./output.js')
|
||||
} else if (/^[a-z]+$/.test(name)) {
|
||||
return require(name)
|
||||
} else {
|
||||
throw new Error('I didn\'t expect you to require ' + name)
|
||||
}
|
||||
})
|
||||
})
|
||||
transform.end(fs.readFileSync(require.resolve('uglify-js'), 'utf8'))
|
Reference in New Issue
Block a user