html-bundler-webpack-plugin
Version:
Generates complete single-page or multi-page website from source assets. Built-in support for Markdown, Eta, EJS, Handlebars, Nunjucks, Pug. Alternative to html-webpack-plugin.
11 lines (7 loc) • 312 B
JavaScript
const { pathToFileURL } = require('url');
const esmLoader = (absolutePath) => {
const fileUrl = pathToFileURL(absolutePath).href;
// Note: read real data after changes from root file, sub-imported files are still cached.
return import(`${fileUrl}?nocache=${Date.now()}`);
};
module.exports = esmLoader;