Skip to content

Commit 3ae600c

Browse files
author
Yoshiki Shibukawa
committed
reduce npm package file size 95%
1 parent 6704e4e commit 3ae600c

File tree

11 files changed

+2795
-2505
lines changed

11 files changed

+2795
-2505
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
!.gitkeep
2+
.DS_Store
23

34
# temporary files
45

.npmignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ bootstrap/
1111
.jsx
1212
tmp/
1313

14+
1415
# products
1516

1617
try/
1718
doc/
19+
example/
1820

1921
# npm-related files
2022

@@ -37,3 +39,27 @@ linux-*
3739
# git stuff
3840

3941
.git*
42+
43+
# only for JSX compiler developer
44+
45+
t/
46+
src/
47+
.travis.yml
48+
.npmignore
49+
.proverc
50+
extlib/
51+
gruntfile.js
52+
submodules/
53+
xt/
54+
release-engineering.md
55+
idl2jsx/
56+
tool/bootstrap-compiler.js
57+
tool/git-hooks-pre-push
58+
tool/form
59+
tool/Util.pm
60+
tool/jsx.pl
61+
tool/make-meta
62+
tool/postpublish.jsx
63+
tool/setup.pl
64+
tool/toggle-todo
65+
web/
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/jsemitter.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3027,7 +3027,7 @@ abstract class _BootstrapBuilder {
30273027
}
30283028

30293029
function addBootstrap(code : string) : string {
3030-
code += this._emitter._platform.load(this._emitter._platform.getRoot() + "/src/js/launcher.js");
3030+
code += this._emitter._platform.load(this._emitter._platform.getRoot() + "/lib/js-startup/launcher.js");
30313031

30323032
var args;
30333033
switch (this._executableFor) {
@@ -3054,7 +3054,7 @@ abstract class _BootstrapBuilder {
30543054
abstract function _getLauncher() : string;
30553055

30563056
function _wrapOnLoad(code : string) : string {
3057-
var wrapper = this._emitter._platform.load(this._emitter._platform.getRoot() + "/src/js/web-launcher.js");
3057+
var wrapper = this._emitter._platform.load(this._emitter._platform.getRoot() + "/lib/js-startup/web-launcher.js");
30583058
return wrapper.replace(/\/\/--CODE--\/\//, code);
30593059
}
30603060

@@ -3268,7 +3268,7 @@ class JavaScriptEmitter implements Emitter {
32683268
// headers
32693269
this._output += "// generatedy by JSX compiler " + Meta.IDENTIFIER + "\n";
32703270
this._output += this._fileHeader;
3271-
this._output += this._platform.load(this._platform.getRoot() + "/src/js/bootstrap.js");
3271+
this._output += this._platform.load(this._platform.getRoot() + "/lib/js-startup/bootstrap.js");
32723272

32733273
var stash = (this.getStash(_NoDebugCommand.IDENTIFIER) as _NoDebugCommand.Stash);
32743274
this._emit("JSX.DEBUG = "+(stash == null || stash.debugValue ? "true" : "false")+";\n", null);
@@ -3529,7 +3529,7 @@ class JavaScriptEmitter implements Emitter {
35293529
}
35303530
output += this._output + "\n";
35313531
if (this._enableProfiler) {
3532-
output += this._platform.load(this._platform.getRoot() + "/src/js/profiler.js");
3532+
output += this._platform.load(this._platform.getRoot() + "/lib/js-startup/profiler.js");
35333533
}
35343534
if (this._bootstrapBuilder != null) {
35353535
output = this._bootstrapBuilder.addBootstrap(output);

src/jsx-command.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ class JSXCommand {
426426
return 1;
427427
}
428428
if (compiler.compile()) {
429-
new DocumentGenerator(compiler, platform.getRoot() + "/src/doc", outputFile)
429+
new DocumentGenerator(compiler, platform.getRoot() + "/etc/doc-template", outputFile)
430430
.setResourceFiles(["style.css"])
431431
.setPathFilter(function (sourcePath) {
432432
if (sourcePath.indexOf("system:") == 0) {

0 commit comments

Comments
 (0)