makepack 1.5.16 → 1.5.18

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "makepack",
3
- "version": "1.5.16",
3
+ "version": "1.5.18",
4
4
  "type": "module",
5
5
  "description": "A CLI tool to create, build, and manage JavaScript, TypeScript, React, and React-TypeScript libraries for npm projects.",
6
6
  "files": [
@@ -1,4 +1,4 @@
1
- export default async (args) => {
1
+ export default async () => {
2
2
  const content = {
3
3
  "compilerOptions": {
4
4
  "target": "es5",
@@ -20,9 +20,10 @@ export default async (args) => {
20
20
  "noEmit": true,
21
21
  "jsx": "react"
22
22
  },
23
- "include": [args.rootdir],
23
+ "include": ["src"],
24
24
  "exclude": [
25
- "node_modules"
25
+ "node_modules",
26
+ "build"
26
27
  ]
27
28
  }
28
29
 
@@ -4,13 +4,14 @@ import chalk from 'chalk';
4
4
  import makepackConfig from '../../makepack-config.js';
5
5
  import viteSetup from './vite.js';
6
6
  import userExpress from './user-express.js';
7
+ import path from 'path';
7
8
 
8
9
  const app = express();
9
10
  const server = async () => {
10
11
  const config = await makepackConfig()
11
12
  userExpress(app)
12
13
  await viteSetup(app)
13
-
14
+ app.use(express.static(path.join(process.cwd(), 'public')));
14
15
  app.use((_req, res) => {
15
16
  res.status(500).send('Internal Server Error');
16
17
  });
@@ -39,7 +39,6 @@ const start = async () => {
39
39
  process.exit(1)
40
40
  }
41
41
 
42
- startServer(config)
43
42
  const expressjs = path.join(process.cwd(), 'express.js')
44
43
  const expressts = path.join(process.cwd(), 'express.ts')
45
44
 
@@ -76,6 +75,7 @@ const start = async () => {
76
75
  process.exit(0);
77
76
  });
78
77
  }
78
+ startServer(config)
79
79
  }
80
80
 
81
81
  export default start
@@ -1,6 +1,5 @@
1
1
  // express.ts
2
2
  var express = (app) => {
3
-
4
3
  };
5
4
  var express_default = express;
6
5
  export {
@@ -7,6 +7,7 @@ const viteSetup = async (app) => {
7
7
  const config = await makepackConfig()
8
8
  const viteConfig = {
9
9
  root: process.cwd(),
10
+ base: "/",
10
11
  // plugins: [react()],
11
12
  server: {
12
13
  middlewareMode: true,
@@ -26,6 +27,7 @@ const viteSetup = async (app) => {
26
27
 
27
28
  app.get('*', async (req, res, next) => {
28
29
  const url = req.originalUrl;
30
+
29
31
  try {
30
32
  let template = await vite.transformIndexHtml(url, `
31
33
  <!doctype html>
@@ -40,6 +42,7 @@ const viteSetup = async (app) => {
40
42
  </body>
41
43
  </html>
42
44
  `);
45
+
43
46
  res.status(200).set({
44
47
  'Content-Type': 'text/html'
45
48
  }).end(template);