tauri/mode/entry.js
nothingismagick f0d95a4244 feat(alpha) prep (#27)
* feat(testing) add test apps, docs for testing

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* feat(testing) add test apps, docs for testing, fix entry and generator

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* feat(tauri) use require.resolve

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* feat(rust) fix for cargo sources

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* chore(version) bump

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* feat(tauri) setup tauri object

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* feat(demo) setup tauri object

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* feat(entry) fix generator

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* feat(docs) prepare quasar spa docs

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>
2019-08-22 16:46:45 -03:00

16 lines
546 B
JavaScript

const compileTemplate = require('lodash.template'),
{ readFileSync, writeFileSync, ensureDir } = require('fs-extra'),
path = require('path')
module.exports.generate = (outDir, cfg, ctx, tauri = false) => {
const apiTemplate = readFileSync(path.resolve(__dirname, '../lib/tauri.js'), 'utf-8')
const apiContent = compileTemplate(apiTemplate)({
...cfg,
ctx: ctx,
confName: `${tauri ? 'tauri' : 'quasar'}.conf.js`
})
ensureDir(outDir).then(() => {
writeFileSync(path.join(outDir, 'tauri.js'), apiContent, 'utf-8')
})
}