Skip to content

Commit

Permalink
chore: update webpack config
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed Jul 3, 2023
1 parent d465aeb commit 1ae41b5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@ const CopyPlugin = require("copy-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const webpack = require("webpack");
const InjectPlugin = require("webpack-inject-plugin").default;
const { config } = require("dotenv");

config();
const isDevMode = process.env.NODE_ENV === "development";

module.exports = {
entry: "./src/main.ts",
output: {
path: path.resolve(__dirname, "."),
path: path.resolve(isDevMode ? process.env.OUTDIR : __dirname, "."),
filename: "main.js",
libraryTarget: "commonjs"
},
target: "node",
mode: isDevMode ? "development" : "production",
watch: isDevMode,
...(isDevMode ? { devtool: "eval" } : {}),
module: {
rules: [
Expand Down Expand Up @@ -93,4 +96,4 @@ module.exports = {
obsidian: "commonjs2 obsidian",
moment: "commonjs2 moment"
}
};
};

0 comments on commit 1ae41b5

Please sign in to comment.