makepack 1.5.14 → 1.5.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -3,20 +3,12 @@ import { logger } from '../../helpers.js'
|
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
import makepackConfig from '../../makepack-config.js';
|
|
5
5
|
import viteSetup from './vite.js';
|
|
6
|
-
import
|
|
6
|
+
import userExpress from './user-express.js';
|
|
7
7
|
|
|
8
8
|
const app = express();
|
|
9
9
|
const server = async () => {
|
|
10
10
|
const config = await makepackConfig()
|
|
11
|
-
|
|
12
|
-
const result = await explorer.load('.server/express.js');
|
|
13
|
-
if (result) {
|
|
14
|
-
if (typeof result.config !== 'function') {
|
|
15
|
-
logger.error('Configuration file must export a function')
|
|
16
|
-
}
|
|
17
|
-
result.config(app)
|
|
18
|
-
}
|
|
19
|
-
|
|
11
|
+
userExpress(app)
|
|
20
12
|
await viteSetup(app)
|
|
21
13
|
|
|
22
14
|
app.use((_req, res) => {
|
|
@@ -17,7 +17,7 @@ if (typeof import.meta.url !== 'undefined') {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
let server = null;
|
|
20
|
-
function startServer(
|
|
20
|
+
function startServer() {
|
|
21
21
|
if (server) {
|
|
22
22
|
server.kill('SIGINT');
|
|
23
23
|
server = null;
|
|
@@ -48,7 +48,7 @@ const start = async () => {
|
|
|
48
48
|
const build = () => {
|
|
49
49
|
esbuild.build({
|
|
50
50
|
entryPoints: [filename],
|
|
51
|
-
outfile: '
|
|
51
|
+
outfile: path.resolve(__dirname, 'custom-express.js'),
|
|
52
52
|
bundle: true,
|
|
53
53
|
format: 'esm',
|
|
54
54
|
platform: 'node',
|