From d1d1293b3d5ce33bf172321fe66f85fe4f1a5e5b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 21 Aug 2020 14:47:09 +0200 Subject: [PATCH] Improve webpack template --- webpack.config.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 15359a1..c73f592 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -2,15 +2,19 @@ const path = require("path") const EsmWebpackPlugin = require("@purtuga/esm-webpack-plugin") -let config = { - entry: "./client/common-client-plugin.js", +const clientFiles = [ + 'common-client-plugin.js' +] + +let config = clientFiles.map(f => ({ + entry: "./client/" + f, output: { path: path.resolve(__dirname, "./dist"), - filename: "./common-client-plugin.js", + filename: "./" + f, library: "script", libraryTarget: "var" }, - plugins: [new EsmWebpackPlugin()] -} + plugins: [ new EsmWebpackPlugin() ] +})) module.exports = config