UNPKG

nodemon-webpack-plugin

Version:

A webpack plugin that starts and reloads a server using Nodemon.

22 lines (16 loc) 600 B
"use strict"; var path = require('path'); var notMapFile = function notMapFile(file) { return !file.endsWith('.map'); }; // Returns the first assets that is not a map file var getOutputFileName = function getOutputFileName(compilation) { return Object.keys(compilation.assets).filter(notMapFile)[0]; }; var getOutputFileMeta = function getOutputFileMeta(compilation, outputPath) { var outputFileName = getOutputFileName(compilation); var absoluteFileName = path.join(outputPath, outputFileName); return path.relative('', absoluteFileName); }; module.exports = { getOutputFileMeta };