Bake simple dependencies into their dependent files for self-contained packages
bake-dependencies
turns this:
const import = require('./import') // src/index.js
module.exports = 'IMPORT' // src/import.js
into this:
const import = "IMPORT" // index.js
IMPORTANT: This works only for primitive data, no functions!
npx bake-dependencies src/index.js index.js
const bakeFS = require('bake-dependencies/fs')
bakeFS('src/index.js', 'index.js')
const bake = require('bake-dependencies')
const sourceFile = fs.readFileSync('src/index.js')
const bakedFile = bake(sourceFile, 'src')