mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-24 11:14:40 +03:00
f0d95a4244
* 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>
16 lines
546 B
JavaScript
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')
|
|
})
|
|
}
|