UNPKG

cckj-util

Version:

A common util lib for cj

38 lines (34 loc) 802 B
const HtmlWebpackPlugin = require("html-webpack-plugin"); const { join, resolve } = require("path"); function resolveFile(filePath) { return resolve(__dirname, "..", filePath); } let webpackConfig = { entry: resolveFile("src/index.js"), output: { path: resolveFile("dist"), filename: "bundle.[hash:8].js", library: 'CJ', libraryExport: "default", libraryTarget: 'umd', }, plugins: [ new HtmlWebpackPlugin({ filename: resolveFile("dist/index.html"), template: resolveFile("public/index.html"), }), ], resolve: { alias: { "@": resolveFile("src"), }, }, devtool:'cheap-module-source-map', devServer:{ contentBase:resolveFile("dist"), host: '0.0.0.0', port: 9089, open:true } }; module.exports = webpackConfig;