UNPKG

855 BJavaScriptView Raw
1"use strict";
2
3const _path = require("path");
4const webpack = require("webpack");
5const merge = require("webpack-merge");
6
7module.exports = ({ configurations }) => {
8 return new Promise((resolve, reject) => {
9 const devIndexConfig = {
10 node: {
11 fs: "empty"
12 },
13 name: "server",
14 target: "node",
15 entry: {
16 site: _path.join(__dirname, "../build/site.js")
17 },
18 output: {
19 path: _path.join(process.cwd(), "./.antwar/build/"),
20 filename: "[name].js",
21 publicPath: "/",
22 libraryTarget: "commonjs2"
23 }
24 };
25
26 webpack(merge(devIndexConfig, configurations.webpack), (err, stats) => {
27 if (err) {
28 return reject(err);
29 }
30
31 if (stats.hasErrors()) {
32 return reject(stats.toString("errors-only"));
33 }
34
35 return resolve();
36 });
37 });
38};
\No newline at end of file