2020-09-11 03:25:57 +03:00
|
|
|
const path = require("path");
|
|
|
|
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
|
|
|
|
|
|
|
console.log("OUTPUT: " + path.join(__dirname, "dist"));
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
mode: "development",
|
|
|
|
entry: {
|
|
|
|
index: "./src/index.js",
|
|
|
|
dashboard: "./src/page-dashboard/index.js",
|
2020-09-11 03:42:27 +03:00
|
|
|
backlog: "./src/page-backlog/index.js",
|
2020-09-11 04:09:50 +03:00
|
|
|
detail: "./src/page-detail/index.js",
|
2020-09-11 03:25:57 +03:00
|
|
|
},
|
|
|
|
devServer: {
|
2023-08-03 04:28:01 +03:00
|
|
|
static: path.join(__dirname, "dist"),
|
2020-09-11 03:25:57 +03:00
|
|
|
port: 8082,
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.css$/,
|
|
|
|
use: ["style-loader", "css-loader"],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.html$/,
|
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: "file-loader",
|
|
|
|
options: {
|
|
|
|
name: "[name].[ext]",
|
|
|
|
outputPath: "/",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(png|jpg|gif)$/,
|
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: "file-loader",
|
|
|
|
options: {},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
|
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: "file-loader",
|
|
|
|
options: {
|
|
|
|
name: "[name].[ext]",
|
|
|
|
outputPath: "fonts/",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
plugins: [
|
2023-08-03 04:28:01 +03:00
|
|
|
|
2020-09-11 03:25:57 +03:00
|
|
|
new CopyWebpackPlugin(
|
2023-08-03 04:28:01 +03:00
|
|
|
{
|
|
|
|
patterns: [
|
|
|
|
{ from: "src/page-dashboard",
|
|
|
|
to: "page-dashboard",
|
|
|
|
globOptions: {
|
|
|
|
ignore: ["**/*.js", "**/*.css"]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ from: "src/page-backlog",
|
|
|
|
to: "page-backlog",
|
|
|
|
globOptions: {
|
|
|
|
ignore: ["**/*.js", "**/*.css"]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ from: "src/page-detail",
|
|
|
|
to: "page-detail",
|
|
|
|
globOptions: {
|
|
|
|
ignore: ["**/*.js", "**/*.css"]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|
2020-09-11 03:25:57 +03:00
|
|
|
),
|
2023-08-03 04:28:01 +03:00
|
|
|
|
|
|
|
|
2020-09-11 03:25:57 +03:00
|
|
|
],
|
|
|
|
resolve: {
|
|
|
|
extensions: [".js", ".css"],
|
|
|
|
},
|
|
|
|
output: {
|
|
|
|
filename: "[name].bundle.js",
|
|
|
|
path: __dirname + "/dist",
|
|
|
|
},
|
|
|
|
//target: 'node',
|
|
|
|
//externals: [nodeExternals()],
|
|
|
|
optimization: {
|
|
|
|
splitChunks: {
|
|
|
|
cacheGroups: {
|
|
|
|
vendor: {
|
|
|
|
name: "vendor",
|
|
|
|
chunks: "all",
|
|
|
|
test: (module, chunks) => {
|
|
|
|
const moduleName = module.nameForCondition
|
|
|
|
? module.nameForCondition()
|
|
|
|
: "";
|
|
|
|
return /[\\/]node_modules[\\/]/.test(moduleName);
|
|
|
|
},
|
|
|
|
enforce: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|