Skip to content

Commit

Permalink
feat: add @remix-run/node/install side-effect to allow --require (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-ebey authored Apr 21, 2023
1 parent 320c7ea commit e61cdc8
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/install-globals.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@remix-run/node": patch
"@remix-run/serve": patch
---

add `@remix-run/node/install` side-effect to allow `node --require @remix-run/node/install`
1 change: 1 addition & 0 deletions packages/remix-node/install.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
8 changes: 8 additions & 0 deletions packages/remix-node/install.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* eslint-disable */
'use strict';

var globals = require('./dist/globals.js');

Object.defineProperty(exports, '__esModule', { value: true });

globals.installGlobals();
2 changes: 1 addition & 1 deletion packages/remix-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"sideEffects": false,
"sideEffects": ["./install.js"],
"dependencies": {
"@remix-run/server-runtime": "1.15.0",
"@remix-run/web-fetch": "^4.3.2",
Expand Down
5 changes: 5 additions & 0 deletions packages/remix-node/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ module.exports = function rollup() {
{ src: "LICENSE.md", dest: [outputDir, sourceDir] },
{ src: `${sourceDir}/package.json`, dest: outputDir },
{ src: `${sourceDir}/README.md`, dest: outputDir },
// This needs to end up in the root of the pkg but also needs to
// reference other compiled files. Just copying these are easier
// than dealing with output configuration for sharing chunks x-builds.
{ src: `${sourceDir}/install.js`, dest: outputDir },
{ src: `${sourceDir}/install.d.ts`, dest: outputDir },
],
}),
magicExportsPlugin({ packageName, version }),
Expand Down
2 changes: 2 additions & 0 deletions packages/remix-serve/env.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
import "@remix-run/node/install";

process.env.NODE_ENV = process.env.NODE_ENV || "production";
1 change: 1 addition & 0 deletions packages/remix-serve/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
},
"dependencies": {
"@remix-run/express": "1.15.0",
"@remix-run/node": "1.15.0",
"compression": "^1.7.4",
"express": "^4.17.1",
"morgan": "^1.10.0"
Expand Down

0 comments on commit e61cdc8

Please sign in to comment.