Skip to content

reduce npm package file size 95% #309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
!.gitkeep
.DS_Store

# temporary files

Expand Down
26 changes: 26 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ bootstrap/
.jsx
tmp/


# products

try/
doc/
example/

# npm-related files

Expand All @@ -37,3 +39,27 @@ linux-*
# git stuff

.git*

# only for JSX compiler developer

t/
src/
.travis.yml
.npmignore
.proverc
extlib/
gruntfile.js
submodules/
xt/
release-engineering.md
idl2jsx/
tool/bootstrap-compiler.js
tool/git-hooks-pre-push
tool/form
tool/Util.pm
tool/jsx.pl
tool/make-meta
tool/postpublish.jsx
tool/setup.pl
tool/toggle-todo
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.
8 changes: 4 additions & 4 deletions src/jsemitter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3027,7 +3027,7 @@ abstract class _BootstrapBuilder {
}

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

var args;
switch (this._executableFor) {
Expand All @@ -3054,7 +3054,7 @@ abstract class _BootstrapBuilder {
abstract function _getLauncher() : string;

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

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

var stash = (this.getStash(_NoDebugCommand.IDENTIFIER) as _NoDebugCommand.Stash);
this._emit("JSX.DEBUG = "+(stash == null || stash.debugValue ? "true" : "false")+";\n", null);
Expand Down Expand Up @@ -3529,7 +3529,7 @@ class JavaScriptEmitter implements Emitter {
}
output += this._output + "\n";
if (this._enableProfiler) {
output += this._platform.load(this._platform.getRoot() + "/src/js/profiler.js");
output += this._platform.load(this._platform.getRoot() + "/lib/js-startup/profiler.js");
}
if (this._bootstrapBuilder != null) {
output = this._bootstrapBuilder.addBootstrap(output);
Expand Down
2 changes: 1 addition & 1 deletion src/jsx-command.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ class JSXCommand {
return 1;
}
if (compiler.compile()) {
new DocumentGenerator(compiler, platform.getRoot() + "/src/doc", outputFile)
new DocumentGenerator(compiler, platform.getRoot() + "/etc/doc-template", outputFile)
.setResourceFiles(["style.css"])
.setPathFilter(function (sourcePath) {
if (sourcePath.indexOf("system:") == 0) {
Expand Down
Loading