parent
c205b89523
commit
2e3d9a6265
@ -6,7 +6,7 @@ module.exports = (app) => {
|
|||||||
log.debug("Starting server in development mode");
|
log.debug("Starting server in development mode");
|
||||||
|
|
||||||
const webpack = require("webpack");
|
const webpack = require("webpack");
|
||||||
const webpackConfig = require("../../webpack.config.js");
|
const webpackConfig = require("../../webpack.config.js")(undefined, {mode: "production"});
|
||||||
|
|
||||||
webpackConfig.plugins.push(new webpack.HotModuleReplacementPlugin());
|
webpackConfig.plugins.push(new webpack.HotModuleReplacementPlugin());
|
||||||
webpackConfig.entry["js/bundle.js"].push(
|
webpackConfig.entry["js/bundle.js"].push(
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const webpack = require("webpack");
|
const webpack = require("webpack");
|
||||||
const fs = require("fs");
|
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const CopyPlugin = require("copy-webpack-plugin");
|
const CopyPlugin = require("copy-webpack-plugin");
|
||||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||||||
@ -17,6 +16,7 @@ const config = {
|
|||||||
},
|
},
|
||||||
devtool: "source-map",
|
devtool: "source-map",
|
||||||
output: {
|
output: {
|
||||||
|
clean: true, // Clean the output directory before emit.
|
||||||
path: path.resolve(__dirname, "public"),
|
path: path.resolve(__dirname, "public"),
|
||||||
filename: "[name]",
|
filename: "[name]",
|
||||||
publicPath: "/",
|
publicPath: "/",
|
||||||
@ -144,12 +144,6 @@ const config = {
|
|||||||
|
|
||||||
module.exports = (env, argv) => {
|
module.exports = (env, argv) => {
|
||||||
if (argv.mode === "development") {
|
if (argv.mode === "development") {
|
||||||
const testFile = path.resolve(__dirname, "test/public/testclient.js");
|
|
||||||
|
|
||||||
if (fs.existsSync(testFile)) {
|
|
||||||
fs.unlinkSync(testFile);
|
|
||||||
}
|
|
||||||
|
|
||||||
config.target = "node";
|
config.target = "node";
|
||||||
config.devtool = "eval";
|
config.devtool = "eval";
|
||||||
config.stats = "errors-only";
|
config.stats = "errors-only";
|
||||||
@ -173,7 +167,9 @@ module.exports = (env, argv) => {
|
|||||||
// Disable plugins like copy files, it is not required
|
// Disable plugins like copy files, it is not required
|
||||||
config.plugins = [
|
config.plugins = [
|
||||||
new VueLoaderPlugin(),
|
new VueLoaderPlugin(),
|
||||||
|
new MiniCssExtractPlugin({
|
||||||
|
filename: "css/style.css",
|
||||||
|
}),
|
||||||
// Client tests that require Vue may end up requireing socket.io
|
// Client tests that require Vue may end up requireing socket.io
|
||||||
new webpack.NormalModuleReplacementPlugin(
|
new webpack.NormalModuleReplacementPlugin(
|
||||||
/js(\/|\\)socket\.js/,
|
/js(\/|\\)socket\.js/,
|
||||||
|
Loading…
Reference in New Issue
Block a user