Browse Source

Attempt N to fix templating under yarn2nix

Sven Slootweg 11 months ago
parent
commit
789e91e242
3 changed files with 11 additions and 2 deletions
  1. 9 1
      bin/matrix-rooms
  2. 1 0
      package.json
  3. 1 1
      yarn.lock

+ 9 - 1
bin/matrix-rooms

@ -13,6 +13,14 @@ const bhttp = require("bhttp");
13 13
const createError = require("create-error");
14 14
const { ValidationError, validateValue, required, isString } = require("validatem");
15 15
16
require('@babel/register')({
17
	extensions: [".jsx"],
18
	presets: [
19
		require.resolve("@babel/preset-react"),
20
		[require.resolve("@babel/preset-env"), { targets: { node: "current" } }]
21
	]
22
});
23
16 24
let UpstreamError = createError("UpstreamError");
17 25
18 26
function generateSince(hostname, token) {
@ -26,7 +34,7 @@ let app = express();
26 34
27 35
app.set("views", path.join(__dirname, "../views"));
28 36
app.set("view engine", "jsx");
29
app.engine("jsx", expressReactViews.createEngine());
37
app.engine("jsx", expressReactViews.createEngine({ transformViews: false }));
30 38
31 39
app.use(express.static(path.join(__dirname, "../public")));
32 40

+ 1 - 0
package.json

@ -12,6 +12,7 @@
12 12
    "@babel/plugin-transform-flow-strip-types": "^7.4.4",
13 13
    "@babel/preset-env": "^7.5.5",
14 14
    "@babel/preset-react": "^7.0.0",
15
    "@babel/register": "^7.5.5",
15 16
    "@joepie91/express-react-views": "^1.0.1",
16 17
    "@modular-matrix/autodiscover-client-configuration": "^1.0.0",
17 18
    "bhttp": "^1.2.4",

+ 1 - 1
yarn.lock

@ -678,7 +678,7 @@
678 678
    "@babel/plugin-transform-react-jsx-self" "^7.0.0"
679 679
    "@babel/plugin-transform-react-jsx-source" "^7.0.0"
680 680
681
"@babel/register@^7.0.0":
681
"@babel/register@^7.0.0", "@babel/register@^7.5.5":
682 682
  version "7.5.5"
683 683
  resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.5.5.tgz#40fe0d474c8c8587b28d6ae18a03eddad3dac3c1"
684 684
  integrity sha512-pdd5nNR+g2qDkXZlW1yRCWFlNrAn2PPdnZUB72zjX4l1Vv4fMRRLwyf+n/idFCLI1UgVGboUU8oVziwTBiyNKQ==