Version: 0.0.1
Last Updated: Unknown
Node scaffold for Netlify. Adds netlify.toml file to your project.
It requires a siteId passed through.
# key name netlify: # building for node - react: siteId: saga-build.nodular.co
1#!/usr/bin/env node23const dir = __dirname;4const path = process.cwd();5const appDir = path;67/**8 * Build out the Circle CI file9 * using the circleci.ejs template10 * file.11 *12 * @param {*} data13 */14const buildNetlify = ({ dependencies, data }) => {15 dependencies.ejs.renderFile(`${dir}/netlify.ejs`, data, {}, function (16 err,17 str,18 ) {19 // str => Rendered HTML string20 if (err) {21 console.log(err);22 throw err;23 }2425 const outputFilePath = `${appDir}/netlify.toml`;26 dependencies.fs.outputFileSync(outputFilePath, str);27 console.log('\t- Netlify config file generated');28 });29};3031/**32 * Bridge the Netlify file33 *34 * @example35 * lift up up.yml36 *37 * @param {*} options38 */39module.exports = function (options) {40 console.log('Bridging Netlify toml file');41 try {42 // map the correct types across43 buildNetlify(options);4445 return options;46 } catch (err) {47 console.error(err);48 }49};
1[Settings]2ID = "<%= siteId %>"34[build]5 command = "yarn build"6 publish = "build"78# The following redirect is intended for use with most SPAs that handle9# routing internally.10[[redirects]]11 from = "/*"12 to = "/index.html"13 status = 200