Skip to content

Commit

Permalink
Allow bare files on the server
Browse files Browse the repository at this point in the history
This restriction was originally in place because we did not know of a
use case for bare files on the server.  The main use case for bare files
is putting pre-existing files in your app which expect top-level `var`s
to be "exported", which is common in browsers but not in Node.

However, there is a use case for this on the server: putting
pre-existing files that were originally written with clients in mind but
which function fine on the server into your server code. So we'll relax
the restriction.

Fixes meteor#3681.
  • Loading branch information
glasser committed Apr 1, 2015
1 parent 8557d05 commit 0371c4f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
this could either lead to the file being included multiple times, or to a
build time crash.

* You may now specify the `bare` option for JavaScript files on the server.
Previous versions only allowed this on the client. #3681


### `meteor` command-line tool

Expand Down
2 changes: 0 additions & 2 deletions tools/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -704,8 +704,6 @@ var compileUnibuild = function (options) {
throw new Error("'data' option to addJavaScript must be a string");
if (typeof options.sourcePath !== "string")
throw new Error("'sourcePath' option must be supplied to addJavaScript. Consider passing inputPath.");
if (options.bare && ! archinfo.matches(inputSourceArch.arch, "web"))
throw new Error("'bare' option may only be used for web targets");

// By default, use fileOptions for the `bare` option but also allow
// overriding it with the options
Expand Down

0 comments on commit 0371c4f

Please sign in to comment.