waveterm/webpack.dev.js

37 lines
936 B
JavaScript
Raw Normal View History

2023-08-22 06:37:04 +02:00
const webpack = require("webpack");
const merge = require("webpack-merge");
const common = require("./webpack.common.js");
const path = require("path");
2022-06-08 02:25:35 +02:00
const CopyPlugin = require("copy-webpack-plugin");
const VERSION = require("./version.js");
2022-06-08 02:25:35 +02:00
var merged = merge.merge(common, {
mode: "development",
output: {
path: path.resolve(__dirname, "dist-dev"),
filename: "[name].js",
},
2022-06-08 02:25:35 +02:00
devtool: "source-map",
devServer: {
static: {
directory: path.join(__dirname, "static"),
},
port: 9000,
headers: {
2023-08-22 06:37:04 +02:00
"Cache-Control": "no-store",
2022-06-08 02:25:35 +02:00
},
},
watchOptions: {
aggregateTimeout: 200,
},
});
var definePlugin = new webpack.DefinePlugin({
__PROMPT_DEV__: "true",
__PROMPT_VERSION__: JSON.stringify(VERSION),
__PROMPT_BUILD__: JSON.stringify("devbuild"),
2022-06-08 02:25:35 +02:00
});
merged.plugins.push(definePlugin);
module.exports = merged;