Improve webpack template
This commit is contained in:
parent
346b3c1534
commit
d1d1293b3d
@ -2,15 +2,19 @@ const path = require("path")
|
|||||||
|
|
||||||
const EsmWebpackPlugin = require("@purtuga/esm-webpack-plugin")
|
const EsmWebpackPlugin = require("@purtuga/esm-webpack-plugin")
|
||||||
|
|
||||||
let config = {
|
const clientFiles = [
|
||||||
entry: "./client/common-client-plugin.js",
|
'common-client-plugin.js'
|
||||||
|
]
|
||||||
|
|
||||||
|
let config = clientFiles.map(f => ({
|
||||||
|
entry: "./client/" + f,
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve(__dirname, "./dist"),
|
path: path.resolve(__dirname, "./dist"),
|
||||||
filename: "./common-client-plugin.js",
|
filename: "./" + f,
|
||||||
library: "script",
|
library: "script",
|
||||||
libraryTarget: "var"
|
libraryTarget: "var"
|
||||||
},
|
},
|
||||||
plugins: [new EsmWebpackPlugin()]
|
plugins: [ new EsmWebpackPlugin() ]
|
||||||
}
|
}))
|
||||||
|
|
||||||
module.exports = config
|
module.exports = config
|
||||||
|
Loading…
x
Reference in New Issue
Block a user