docusaurus/lib/generate-feed.js
Eric Nakagawa 3b5db4bbf8 2 bug fixes (#98)
* Merge fix

* Updating lock file.

* Bug fix for rss feed truncation...

* Fixes infinite recursive loop for #89

* Removed use of module cache invalidator from feed.js

* Replaced 'latest' babel presets with 'env'

* Ignore temp build folder

* Adding back new truncation logic for RSS

* Updating yarn lock
2017-09-28 14:46:29 -07:00

33 lines
884 B
JavaScript
Executable file

#!/usr/bin/env node
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
require("babel-register")({
babelrc: false,
only: [__dirname, process.cwd() + "/core"],
plugins: [require("./server/translate-plugin.js")],
presets: ["react", "latest"]
});
// initial check that required files are present
const chalk = require("chalk");
const fs = require("fs");
const CWD = process.cwd();
if (!fs.existsSync(CWD + "/siteConfig.js")) {
console.error(
chalk.red("Error: No siteConfig.js file found in website folder!")
);
process.exit(1);
}
// generate rss feed
const feed = require("./server/feed.js");
console.log(feed());