import { isStandalone } from "../app/codeCharta/util/envDetector"

const HtmlWebpackPlugin = require("html-webpack-plugin")
const path = require("path")
const { CleanWebpackPlugin } = require("clean-webpack-plugin")

const dist = path.resolve(__dirname, "../dist/webpack")

const target = isStandalone() ? "node" : "web"

module.exports = {
	mode: "development",
	target,
	entry: "./app/app.ts",
	output: {
		filename: "bundle.js",
		path: dist
	},
	devServer: {
		contentBase: dist,
		compress: true, // enable gzip compression
		hot: true, // hot module replacement. Depends on HotModuleReplacementPlugin
		port: 3000,
		clientLogLevel: "error"
	},
	module: require("./webpack.loaders.js"),
	plugins: [
		new CleanWebpackPlugin(),
		new HtmlWebpackPlugin({
			template: "./app/index.html"
		})
	],
	devtool: "source-map",
	resolve: {
		extensions: [".ts", ".tsx", ".js"]
	}
}

@@ -271,56 +271,8 @@
 %22)%0A%0A
-const target = isStandalone() ? %22node%22 : %22web%22%0A%0A
 modu
@@ -315,16 +315,49 @@
 %0A%09target
+: isStandalone() ? %22node%22 : %22web%22
 ,%0A%09entry

Refactor target usage in module exports directly #815