Skip to content

Commit 521f5f5

Browse files
TrySoundBerkeleyTrue
authored andcommitted
fix: Remove "browser" version
closes #18 Since the problem with uglify is fixed there is not reason to keep browser version which do not add any benefits. Actually it blocks us from distributing `esm` version which is widely used these days and supported by the most popular bundlers like webpack, rollup and parcel. Here's a few links facebook/fbjs#86 (comment) Both uglify and babel minify support evaulation and eliminating ```js (function () { function warning() {} var __DEV__ = 'production' !== 'production' if (__DEV__) { warning = function (msg) { console.log(msg) } } warning() } ()); ``` https://skalman.github.io/UglifyJS-online/ https://babeljs.io/repl#?babili=true&browsers=&build=&builtIns=false&code_lz=BQMwrgdgxgLglgewgAmASmQbwFDOeaeJZAdwEMAnCOCAc3SwF9tdkA3S5AfS4BEBRAGo9kAXmQByAA4UEAEzCxEECcgCEo8dNkKlSCSzxwQqHgOFcMOPHnJUatMfkh6UwALYBnWldY3kUEieCAA2AKYAdCEI9F4-fsjMeMysdtR06NiMqGhoANxAA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&lineWrap=false&presets=babili%2Cenv&prettier=false&targets=&version=6.26.0&envVersion=1.6.2
1 parent 089d8b8 commit 521f5f5

File tree

4 files changed

+51
-92
lines changed

4 files changed

+51
-92
lines changed

browser.js

Lines changed: 0 additions & 62 deletions
This file was deleted.

package-lock.json

Lines changed: 45 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
"version": "3.0.0",
44
"description": "A mirror of Facebook's Warning",
55
"main": "warning.js",
6-
"browser": "browser.js",
76
"browserify": {
87
"transform": [
98
"loose-envify"
109
]
1110
},
1211
"files": [
13-
"browser.js",
1412
"warning.js"
1513
],
1614
"scripts": {
@@ -21,7 +19,8 @@
2119
},
2220
"devDependencies": {
2321
"browserify": "^11.0.1",
24-
"tap": "^1.4.0"
22+
"tap": "^1.4.0",
23+
"uglify-js": "^3.3.25"
2524
},
2625
"repository": {
2726
"type": "git",

test/test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
var browserify = require('browserify');
44
var test = require('tap').test;
55
var vm = require('vm');
6+
var minify = require('uglify-js').minify;
67

78
var file = __dirname + '/package/' + process.env.NODE_ENV + '.js';
89

@@ -19,8 +20,9 @@ test('browserify', function(t) {
1920
});
2021
b.bundle(function(err, src) {
2122
t.notOk(err);
22-
t.notMatch(String(src), /\bprocess\.env\.NODE_ENV\b/);
23-
t.notMatch(String(src), /__DEV__/);
23+
var minified = minify(src).code
24+
t.notMatch(String(minified), /\bprocess\.env\.NODE_ENV\b/);
25+
t.notMatch(String(minified), /__DEV__/);
2426
var c = {console: {}};
2527
vm.runInNewContext(src, c);
2628
c.package(t);

0 commit comments

Comments
 (0)