...
 
Commits (4)
#!/usr/bin/env node
'use strict'
Object.defineProperty(exports, '__esModule', { value: true })
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex }
const path = _interopDefault(require('path'))
......@@ -400,6 +402,7 @@ function PluginRollup () {
name: options.modulename,
banner: options.parameters,
footer: options.footer,
sourcemap: options.sourcemap,
indent: false
},
......@@ -560,6 +563,7 @@ function buildCommand (program) {
.option('-t, --target <path>', 'the target directory where all plugins are located. defaults to ./src/')
.option('-d, --destination <path>', 'the path to save file after the build. defaults to ./game/js/plugins')
.option('-w, --watch', 'Watches files to rebuild when changes occur', startWatch)
.option('-s, --sourcemap', 'choose to generate a sourcemap inline with the plugin')
.action(builder)
}
......@@ -794,3 +798,5 @@ program
if (program.args.length <= 0) {
startInit()
}
exports.builder = builder
......@@ -8,5 +8,6 @@ export function buildCommand (program) {
.option('-t, --target <path>', 'the target directory where all plugins are located. defaults to ./src/')
.option('-d, --destination <path>', 'the path to save file after the build. defaults to ./game/js/plugins')
.option('-w, --watch', 'Watches files to rebuild when changes occur', startWatch)
.option('-s, --sourcemap', 'choose to generate a sourcemap inline with the plugin')
.action(builder)
}
......@@ -24,3 +24,6 @@ program
if (program.args.length <= 0) {
startInit()
}
// Expose builder to API
export * from './builder'
......@@ -14,6 +14,7 @@ export function PluginRollup () {
name: options.modulename,
banner: options.parameters,
footer: options.footer,
sourcemap: options.sourcemap,
indent: false
},
......
......@@ -44,10 +44,22 @@ test('accepts a bundler plugin', async t => {
const destination = global.newTempDir()
await builder({
target: `${target}/fenix-core/main.js`,
sourcemap: true,
bundler: PluginRollup,
destination
})
const files = await fs.readdir(`${destination}/`, 'utf8')
t.deepEqual(files, ['FeniXCore.js'])
})
test('generates a sourcemap', async t => {
const destination = global.newTempDir()
await builder({
target: `${target}/fenix-core/main.js`,
bundler: PluginRollup,
sourcemap: true,
destination
})
const file = await fs.readFile(`${destination}/FeniXCore.js`, 'utf8')
t.snapshot(eol.lf(file))
})
......@@ -66,3 +66,67 @@ Generated by [AVA](https://ava.li).
}({}));␊
`
## generates a sourcemap
> Snapshot 1
`/**␊
* All plugin parameters for this FeniXEngine MV plugin␊
*␊
* @file parameters␊
*␊
* @author FeniXEngine Contributors␊
* @copyright 2018 FeniXEngine␊
* @license {@link https://gitlab.com/FeniXEngineMV/plugins/blob/release/LICENSE|MIT License}␊
*/␊
/*:␊
* @pluginname FeniXCore␊
* @plugindesc The core plugin for FeniXEngine which provides a robust API for plugin developers.␊
*␊
* @author FeniX Contributors (https://fenixenginemv.gitlab.io/)␊
*␊
* @modulename FeniX␊
*␊
* @help␊
--------------------------------------------------------------------------------␊
# TERMS OF USE␊
The plugin may be used in commercial and non-commercial products.␊
For full license details visit https://fenixenginemv.gitlab.io//License␊
Please report all bugs to https://fenixenginemv.gitlab.io//Support␊
--------------------------------------------------------------------------------␊
# INFORMATION␊
FeniXEngine plugin for use with RPG Maker MV␊
*/␊
var FeniX = (function (exports) {␊
'use strict';␊
/**␊
* The plugins Core file, which contains registration and export of important␊
* members.␊
*␊
* @file Core␊
*␊
* @author FeniXEngine Contributers␊
* @copyright 2018 FeniX Engine␊
* @license {@link https://gitlab.com/FeniXEngineMV/plugins/blob/develop/LICENSE|MIT License}␊
*/␊
/**␊
* The version of this plugin␊
* @memberof FeniX␊
*/␊
const VERSION = '2.0.0';␊
exports.VERSION = VERSION;␊
return exports;␊
}({}));␊
//# sourceMappingURL=FeniXCore.js.map␊
`