bake-dependencies
v1.0.0
Published
Bake simple dependencies into their dependent files for self-contained packages
Downloads
2
Readme
bake-dependencies
Bake simple dependencies into their dependent files for self-contained packages
What it does
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!
CLI
npx bake-dependencies src/index.js index.js
node API
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')