flatten-brunch-map
Creates the object to return by a Brunch plugin, with the new sourcemap merged with the preceding sourcemap if necessary.
Install
npm install flatten-brunch-map --save
Usage
const flattenMap = ...const pluginResult =
Example
const flattenMap = const myCompiler = { thisoptions = configpluginsmyPlugin || {} // Tell to myCompiler if user wants sourcemap thisoptionssourceMaps = !!configsourceMaps } { return { try // Do the plugin logic and then call flattenMap with the // received param and the generated code and sourcemap. const output = const result = thisoptionssourceMaps ? : outputcode catch error } } MyPluginprototypebrunchPlugin = trueMyPluginprototypeextension = 'js'MyPluginprototypetype = 'javascript' moduleexports = MyPlugin
What's New
From v2.8.2, the plugin returns a normalized string or plain object with sources
defaulting to the received file path.
Like it? Don't forget your star :)