Exports variables from inside the file by appending exports[...] = ...
statements..
npm i exports-loader --save
require("exports-loader?file,parse=helpers.parse!./file.js");
// adds below code to the file's source:
// exports["file"] = file;
// exports["parse"] = helpers.parse;
require("exports-loader?file!./file.js");
// adds below code to the file's source:
// module.exports = file;
require("exports-loader?[name]!./file.js");
// adds below code to the file's source:
// module.exports = file;
Juho Vepsäläinen |
Joshua Wiens |
Kees Kluskens |
Sean Larkin |