esbuild-helpers 2.0.1 → 2.0.3
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/.vscode/extensions.json +9 -9
- package/.vscode/launch.json +46 -46
- package/LICENSE +20 -20
- package/README.md +49 -49
- package/config_copy.ts +5 -5
- package/config_devserver.ts +77 -77
- package/config_electron.ts +97 -97
- package/config_nodejs.ts +97 -97
- package/config_nodejs_debug.ts +101 -101
- package/config_nodejs_event.ts +100 -100
- package/config_nodejs_prod.ts +98 -98
- package/config_type.ts +73 -73
- package/package.json +44 -45
- package/tailwind.config.js +11 -11
- package/test/package-lock.json +4837 -7971
- package/test/package.json +44 -46
- package/tsconfig-build.json +18 -18
- package/tsconfig.json +66 -66
package/.vscode/extensions.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
{
|
|
2
|
-
"recommendations": [
|
|
3
|
-
"eamodio.gitlens",
|
|
4
|
-
"pflannery.vscode-versionlens",
|
|
5
|
-
"esbenp.prettier-vscode",
|
|
6
|
-
"bierner.lit-html",
|
|
7
|
-
"tobermory.es6-string-html",
|
|
8
|
-
"msjsdiag.debugger-for-chrome"
|
|
9
|
-
]
|
|
1
|
+
{
|
|
2
|
+
"recommendations": [
|
|
3
|
+
"eamodio.gitlens",
|
|
4
|
+
"pflannery.vscode-versionlens",
|
|
5
|
+
"esbenp.prettier-vscode",
|
|
6
|
+
"bierner.lit-html",
|
|
7
|
+
"tobermory.es6-string-html",
|
|
8
|
+
"msjsdiag.debugger-for-chrome"
|
|
9
|
+
]
|
|
10
10
|
}
|
package/.vscode/launch.json
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "0.2.0",
|
|
3
|
-
"configurations": [
|
|
4
|
-
{
|
|
5
|
-
/*
|
|
6
|
-
* Use the "npm run debug-node" to try this
|
|
7
|
-
*/
|
|
8
|
-
"name": "Debug node server instance",
|
|
9
|
-
"type": "node",
|
|
10
|
-
"request": "attach",
|
|
11
|
-
"stopOnEntry": false,
|
|
12
|
-
"outFiles": ["${workspaceFolder}/dist_nodejs/**/*.js"],
|
|
13
|
-
"port": 9229,
|
|
14
|
-
"restart": true,
|
|
15
|
-
"smartStep": true,
|
|
16
|
-
"sourceMaps": true
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
{
|
|
20
|
-
/*
|
|
21
|
-
* run "npm start" then start this and you can debug client side in vscode
|
|
22
|
-
* you need extensions installed and chrome
|
|
23
|
-
*/
|
|
24
|
-
"type": "chrome",
|
|
25
|
-
"request": "launch",
|
|
26
|
-
"name": "Launch Chrome against localhost",
|
|
27
|
-
"url": "http://localhost",
|
|
28
|
-
"webRoot": "${workspaceFolder}//dist_client"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"name": "Run current file (ts-node)",
|
|
32
|
-
"type": "node",
|
|
33
|
-
"request": "launch",
|
|
34
|
-
"args": ["${relativeFile}"],
|
|
35
|
-
"runtimeArgs": ["--nolazy", "-r", "./node_modules/ts-node/register"],
|
|
36
|
-
"sourceMaps": true,
|
|
37
|
-
"cwd": "${workspaceRoot}",
|
|
38
|
-
"protocol": "inspector",
|
|
39
|
-
"console": "integratedTerminal",
|
|
40
|
-
"env": {
|
|
41
|
-
"TS_NODE_TRANSPILE_ONLY": "true",
|
|
42
|
-
"TS_NODE_IGNORE_DIAGNOSTICS": "true"
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
]
|
|
46
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"version": "0.2.0",
|
|
3
|
+
"configurations": [
|
|
4
|
+
{
|
|
5
|
+
/*
|
|
6
|
+
* Use the "npm run debug-node" to try this
|
|
7
|
+
*/
|
|
8
|
+
"name": "Debug node server instance",
|
|
9
|
+
"type": "node",
|
|
10
|
+
"request": "attach",
|
|
11
|
+
"stopOnEntry": false,
|
|
12
|
+
"outFiles": ["${workspaceFolder}/dist_nodejs/**/*.js"],
|
|
13
|
+
"port": 9229,
|
|
14
|
+
"restart": true,
|
|
15
|
+
"smartStep": true,
|
|
16
|
+
"sourceMaps": true
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
{
|
|
20
|
+
/*
|
|
21
|
+
* run "npm start" then start this and you can debug client side in vscode
|
|
22
|
+
* you need extensions installed and chrome
|
|
23
|
+
*/
|
|
24
|
+
"type": "chrome",
|
|
25
|
+
"request": "launch",
|
|
26
|
+
"name": "Launch Chrome against localhost",
|
|
27
|
+
"url": "http://localhost",
|
|
28
|
+
"webRoot": "${workspaceFolder}//dist_client"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "Run current file (ts-node)",
|
|
32
|
+
"type": "node",
|
|
33
|
+
"request": "launch",
|
|
34
|
+
"args": ["${relativeFile}"],
|
|
35
|
+
"runtimeArgs": ["--nolazy", "-r", "./node_modules/ts-node/register"],
|
|
36
|
+
"sourceMaps": true,
|
|
37
|
+
"cwd": "${workspaceRoot}",
|
|
38
|
+
"protocol": "inspector",
|
|
39
|
+
"console": "integratedTerminal",
|
|
40
|
+
"env": {
|
|
41
|
+
"TS_NODE_TRANSPILE_ONLY": "true",
|
|
42
|
+
"TS_NODE_IGNORE_DIAGNOSTICS": "true"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021 Vegar Ringdal
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Vegar Ringdal
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
# esbuild-helpers
|
|
2
|
-
|
|
3
|
-
Simple helper lib to help make js bundles
|
|
4
|
-
|
|
5
|
-
`npm install esbuild-helpers --save-dev`
|
|
6
|
-
|
|
7
|
-
### Docs
|
|
8
|
-
|
|
9
|
-
Atm see config files at root for how to use.
|
|
10
|
-
|
|
11
|
-
* `npm run copy`
|
|
12
|
-
* Shows how to copy files
|
|
13
|
-
* Code: `config_copy.ts`
|
|
14
|
-
* `npm run nodejs:dev`
|
|
15
|
-
* Shows how to run nodejs with restart on changes
|
|
16
|
-
* Code: `config_nodejs.ts`
|
|
17
|
-
* `npm run nodejs:prod`
|
|
18
|
-
* Shows how to make production build for nodejs
|
|
19
|
-
* Code: `config_nodejs_prod.ts`
|
|
20
|
-
* `npm run nodejs:prod:run`
|
|
21
|
-
* Shows how to runn nodejs production build
|
|
22
|
-
* Code: `config_nodejs_prod && node ./dist_nodejs/index.js`
|
|
23
|
-
* `npm run nodejs:debug`
|
|
24
|
-
* Shows how to run nodejs with debug activated
|
|
25
|
-
* Code: `config_nodejs_debug.ts`
|
|
26
|
-
* `npm run nodejs:events`
|
|
27
|
-
* Shows how to trigger events between the builds
|
|
28
|
-
* Code: `config_nodejs_event.ts`
|
|
29
|
-
* `npm run devserver`
|
|
30
|
-
* Shows how run simple dev server (reloads js withour browser reload)
|
|
31
|
-
* Code: `config_devserver.ts`
|
|
32
|
-
* `npm run electron:dev`
|
|
33
|
-
* Shows how run electron
|
|
34
|
-
* Code: `config_electron.ts`
|
|
35
|
-
* `npm run typechecker`
|
|
36
|
-
* Shows how to run typechecking
|
|
37
|
-
* Code: `config_type.ts`
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
You need to have this installed:
|
|
42
|
-
|
|
43
|
-
- esbuild
|
|
44
|
-
- typescript
|
|
45
|
-
- postcss (will just warn if missing)
|
|
46
|
-
- compression (will skip if missing)
|
|
47
|
-
- electron & electron-squirrel-startup (only if you plan to use it)
|
|
48
|
-
|
|
49
|
-
Have these ass dev dependencies so user can use newer version/not dependant of this
|
|
1
|
+
# esbuild-helpers
|
|
2
|
+
|
|
3
|
+
Simple helper lib to help make js bundles
|
|
4
|
+
|
|
5
|
+
`npm install esbuild-helpers --save-dev`
|
|
6
|
+
|
|
7
|
+
### Docs
|
|
8
|
+
|
|
9
|
+
Atm see config files at root for how to use.
|
|
10
|
+
|
|
11
|
+
* `npm run copy`
|
|
12
|
+
* Shows how to copy files
|
|
13
|
+
* Code: `config_copy.ts`
|
|
14
|
+
* `npm run nodejs:dev`
|
|
15
|
+
* Shows how to run nodejs with restart on changes
|
|
16
|
+
* Code: `config_nodejs.ts`
|
|
17
|
+
* `npm run nodejs:prod`
|
|
18
|
+
* Shows how to make production build for nodejs
|
|
19
|
+
* Code: `config_nodejs_prod.ts`
|
|
20
|
+
* `npm run nodejs:prod:run`
|
|
21
|
+
* Shows how to runn nodejs production build
|
|
22
|
+
* Code: `config_nodejs_prod && node ./dist_nodejs/index.js`
|
|
23
|
+
* `npm run nodejs:debug`
|
|
24
|
+
* Shows how to run nodejs with debug activated
|
|
25
|
+
* Code: `config_nodejs_debug.ts`
|
|
26
|
+
* `npm run nodejs:events`
|
|
27
|
+
* Shows how to trigger events between the builds
|
|
28
|
+
* Code: `config_nodejs_event.ts`
|
|
29
|
+
* `npm run devserver`
|
|
30
|
+
* Shows how run simple dev server (reloads js withour browser reload)
|
|
31
|
+
* Code: `config_devserver.ts`
|
|
32
|
+
* `npm run electron:dev`
|
|
33
|
+
* Shows how run electron
|
|
34
|
+
* Code: `config_electron.ts`
|
|
35
|
+
* `npm run typechecker`
|
|
36
|
+
* Shows how to run typechecking
|
|
37
|
+
* Code: `config_type.ts`
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
You need to have this installed:
|
|
42
|
+
|
|
43
|
+
- esbuild
|
|
44
|
+
- typescript
|
|
45
|
+
- postcss (will just warn if missing)
|
|
46
|
+
- compression (will skip if missing)
|
|
47
|
+
- electron & electron-squirrel-startup (only if you plan to use it)
|
|
48
|
+
|
|
49
|
+
Have these ass dev dependencies so user can use newer version/not dependant of this
|
package/config_copy.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
copy
|
|
3
|
-
} from "./src/exported";
|
|
4
|
-
|
|
5
|
-
// see https://www.npmjs.com/package/globby for input patterns
|
|
1
|
+
import {
|
|
2
|
+
copy
|
|
3
|
+
} from "./src/exported";
|
|
4
|
+
|
|
5
|
+
// see https://www.npmjs.com/package/globby for input patterns
|
|
6
6
|
copy('package*', './test')
|
package/config_devserver.ts
CHANGED
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
import {
|
|
2
|
-
clearFolders,
|
|
3
|
-
addDefaultIndex,
|
|
4
|
-
client,
|
|
5
|
-
postcssPlugin,
|
|
6
|
-
single
|
|
7
|
-
} from "./src/exported";
|
|
8
|
-
|
|
9
|
-
clearFolders("dist_client", "dist_nodejs");
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* css so we dont need to wait for postcss unless we change css..
|
|
13
|
-
*/
|
|
14
|
-
single(
|
|
15
|
-
{ watch: "./src_client/**/*.css" },
|
|
16
|
-
{
|
|
17
|
-
color: true,
|
|
18
|
-
define: {
|
|
19
|
-
DEVELOPMENT: "true",
|
|
20
|
-
},
|
|
21
|
-
entryPoints: ["./src_client/index.css"],
|
|
22
|
-
outfile: "./dist_client/index.css",
|
|
23
|
-
plugins: [postcssPlugin([require("tailwindcss")("./tailwind.config.js")])],
|
|
24
|
-
logLevel: "error"
|
|
25
|
-
}
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* client bundle
|
|
31
|
-
*/
|
|
32
|
-
client(
|
|
33
|
-
{ watch: "./src_client/**/*.ts" },
|
|
34
|
-
{
|
|
35
|
-
color: true,
|
|
36
|
-
define: {
|
|
37
|
-
DEVELOPMENT: "true",
|
|
38
|
-
},
|
|
39
|
-
entryPoints: ["./src_client/index.ts"],
|
|
40
|
-
outfile: "./dist_client/index.js",
|
|
41
|
-
plugins:[],
|
|
42
|
-
minify: false,
|
|
43
|
-
bundle: true,
|
|
44
|
-
platform: "browser",
|
|
45
|
-
sourcemap: true,
|
|
46
|
-
logLevel: "error"
|
|
47
|
-
}
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* index file for project
|
|
53
|
-
*/
|
|
54
|
-
addDefaultIndex({
|
|
55
|
-
distFolder: "dist_client",
|
|
56
|
-
entry: "./index.js",
|
|
57
|
-
publicFolders:[],
|
|
58
|
-
hbr: true,
|
|
59
|
-
devServer:true,
|
|
60
|
-
devServerPort:80,
|
|
61
|
-
userInjectOnHbr:
|
|
62
|
-
'window.dispatchEvent(new CustomEvent("SIMPLE_HTML_SAVE_STATE"));',
|
|
63
|
-
indexTemplate: /*html*/ `<!DOCTYPE html>
|
|
64
|
-
<html lang="en">
|
|
65
|
-
<head>
|
|
66
|
-
<meta charset="UTF-8" />
|
|
67
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
68
|
-
<title>Document</title>
|
|
69
|
-
<link href="./index.css" rel="stylesheet" />
|
|
70
|
-
|
|
71
|
-
$bundle
|
|
72
|
-
</head>
|
|
73
|
-
<body>
|
|
74
|
-
</body>
|
|
75
|
-
</html>
|
|
76
|
-
`,
|
|
77
|
-
});
|
|
1
|
+
import {
|
|
2
|
+
clearFolders,
|
|
3
|
+
addDefaultIndex,
|
|
4
|
+
client,
|
|
5
|
+
postcssPlugin,
|
|
6
|
+
single
|
|
7
|
+
} from "./src/exported";
|
|
8
|
+
|
|
9
|
+
clearFolders("dist_client", "dist_nodejs");
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* css so we dont need to wait for postcss unless we change css..
|
|
13
|
+
*/
|
|
14
|
+
single(
|
|
15
|
+
{ watch: "./src_client/**/*.css" },
|
|
16
|
+
{
|
|
17
|
+
color: true,
|
|
18
|
+
define: {
|
|
19
|
+
DEVELOPMENT: "true",
|
|
20
|
+
},
|
|
21
|
+
entryPoints: ["./src_client/index.css"],
|
|
22
|
+
outfile: "./dist_client/index.css",
|
|
23
|
+
plugins: [postcssPlugin([require("tailwindcss")("./tailwind.config.js")])],
|
|
24
|
+
logLevel: "error"
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* client bundle
|
|
31
|
+
*/
|
|
32
|
+
client(
|
|
33
|
+
{ watch: "./src_client/**/*.ts" },
|
|
34
|
+
{
|
|
35
|
+
color: true,
|
|
36
|
+
define: {
|
|
37
|
+
DEVELOPMENT: "true",
|
|
38
|
+
},
|
|
39
|
+
entryPoints: ["./src_client/index.ts"],
|
|
40
|
+
outfile: "./dist_client/index.js",
|
|
41
|
+
plugins:[],
|
|
42
|
+
minify: false,
|
|
43
|
+
bundle: true,
|
|
44
|
+
platform: "browser",
|
|
45
|
+
sourcemap: true,
|
|
46
|
+
logLevel: "error"
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* index file for project
|
|
53
|
+
*/
|
|
54
|
+
addDefaultIndex({
|
|
55
|
+
distFolder: "dist_client",
|
|
56
|
+
entry: "./index.js",
|
|
57
|
+
publicFolders:[],
|
|
58
|
+
hbr: true,
|
|
59
|
+
devServer:true,
|
|
60
|
+
devServerPort:80,
|
|
61
|
+
userInjectOnHbr:
|
|
62
|
+
'window.dispatchEvent(new CustomEvent("SIMPLE_HTML_SAVE_STATE"));',
|
|
63
|
+
indexTemplate: /*html*/ `<!DOCTYPE html>
|
|
64
|
+
<html lang="en">
|
|
65
|
+
<head>
|
|
66
|
+
<meta charset="UTF-8" />
|
|
67
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
68
|
+
<title>Document</title>
|
|
69
|
+
<link href="./index.css" rel="stylesheet" />
|
|
70
|
+
|
|
71
|
+
$bundle
|
|
72
|
+
</head>
|
|
73
|
+
<body>
|
|
74
|
+
</body>
|
|
75
|
+
</html>
|
|
76
|
+
`,
|
|
77
|
+
});
|
package/config_electron.ts
CHANGED
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
import {
|
|
2
|
-
clearFolders,
|
|
3
|
-
addDefaultIndex,
|
|
4
|
-
electron,
|
|
5
|
-
client,
|
|
6
|
-
makeAllPackagesExternalPlugin,
|
|
7
|
-
postcssPlugin,
|
|
8
|
-
single,
|
|
9
|
-
} from "./src/exported";
|
|
10
|
-
|
|
11
|
-
clearFolders("dist_client", "dist_electron_main");
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* css so we dont need to wait for postcss unless we change css..
|
|
15
|
-
*/
|
|
16
|
-
single(
|
|
17
|
-
{ watch: "./src_client/**/*.css" },
|
|
18
|
-
{
|
|
19
|
-
color: true,
|
|
20
|
-
define: {
|
|
21
|
-
DEVELOPMENT: "true",
|
|
22
|
-
},
|
|
23
|
-
entryPoints: ["./src_client/index.css"],
|
|
24
|
-
outfile: "./dist_client/index.css",
|
|
25
|
-
plugins: [postcssPlugin([require("tailwindcss")("./tailwind.config.js")])],
|
|
26
|
-
logLevel: "error"
|
|
27
|
-
}
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* client bundle
|
|
32
|
-
*/
|
|
33
|
-
client(
|
|
34
|
-
{ watch: "./src_client/**/*.ts" },
|
|
35
|
-
{
|
|
36
|
-
color: true,
|
|
37
|
-
define: {
|
|
38
|
-
DEVELOPMENT: "true",
|
|
39
|
-
},
|
|
40
|
-
entryPoints: ["./src_client/index.ts"],
|
|
41
|
-
outfile: "./dist_client/index.js",
|
|
42
|
-
minify: false,
|
|
43
|
-
bundle: true,
|
|
44
|
-
platform: "browser",
|
|
45
|
-
sourcemap: true,
|
|
46
|
-
logLevel: "error"
|
|
47
|
-
}
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* index file for project
|
|
52
|
-
*/
|
|
53
|
-
addDefaultIndex({
|
|
54
|
-
distFolder: "dist_client",
|
|
55
|
-
entry: "./index.js",
|
|
56
|
-
publicFolders:[],
|
|
57
|
-
hbr: true,
|
|
58
|
-
webSocketPort: 8080,
|
|
59
|
-
userInjectOnHbr:
|
|
60
|
-
'window.dispatchEvent(new CustomEvent("SIMPLE_HTML_SAVE_STATE"));',
|
|
61
|
-
indexTemplate: /*html*/ `<!DOCTYPE html>
|
|
62
|
-
<html lang="en">
|
|
63
|
-
<head>
|
|
64
|
-
<meta charset="UTF-8" />
|
|
65
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
66
|
-
<title>Document</title>
|
|
67
|
-
<link href="./index.css" rel="stylesheet" />
|
|
68
|
-
|
|
69
|
-
$bundle
|
|
70
|
-
</head>
|
|
71
|
-
<body>
|
|
72
|
-
</body>
|
|
73
|
-
</html>
|
|
74
|
-
`,
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* electron bundle
|
|
79
|
-
*/
|
|
80
|
-
electron(
|
|
81
|
-
{ watch: "./src_electron_main/**/*.ts", launch: true },
|
|
82
|
-
{
|
|
83
|
-
color: true,
|
|
84
|
-
define: {
|
|
85
|
-
DEVELOPMENT: "true",
|
|
86
|
-
},
|
|
87
|
-
entryPoints: ["./src_electron_main/index.ts"],
|
|
88
|
-
outfile: "./dist_electron_main/index.js",
|
|
89
|
-
minify: false,
|
|
90
|
-
target: "node14",
|
|
91
|
-
bundle: true,
|
|
92
|
-
plugins: [makeAllPackagesExternalPlugin],
|
|
93
|
-
platform: "node",
|
|
94
|
-
sourcemap: true,
|
|
95
|
-
logLevel: "error"
|
|
96
|
-
}
|
|
97
|
-
);
|
|
1
|
+
import {
|
|
2
|
+
clearFolders,
|
|
3
|
+
addDefaultIndex,
|
|
4
|
+
electron,
|
|
5
|
+
client,
|
|
6
|
+
makeAllPackagesExternalPlugin,
|
|
7
|
+
postcssPlugin,
|
|
8
|
+
single,
|
|
9
|
+
} from "./src/exported";
|
|
10
|
+
|
|
11
|
+
clearFolders("dist_client", "dist_electron_main");
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* css so we dont need to wait for postcss unless we change css..
|
|
15
|
+
*/
|
|
16
|
+
single(
|
|
17
|
+
{ watch: "./src_client/**/*.css" },
|
|
18
|
+
{
|
|
19
|
+
color: true,
|
|
20
|
+
define: {
|
|
21
|
+
DEVELOPMENT: "true",
|
|
22
|
+
},
|
|
23
|
+
entryPoints: ["./src_client/index.css"],
|
|
24
|
+
outfile: "./dist_client/index.css",
|
|
25
|
+
plugins: [postcssPlugin([require("tailwindcss")("./tailwind.config.js")])],
|
|
26
|
+
logLevel: "error"
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* client bundle
|
|
32
|
+
*/
|
|
33
|
+
client(
|
|
34
|
+
{ watch: "./src_client/**/*.ts" },
|
|
35
|
+
{
|
|
36
|
+
color: true,
|
|
37
|
+
define: {
|
|
38
|
+
DEVELOPMENT: "true",
|
|
39
|
+
},
|
|
40
|
+
entryPoints: ["./src_client/index.ts"],
|
|
41
|
+
outfile: "./dist_client/index.js",
|
|
42
|
+
minify: false,
|
|
43
|
+
bundle: true,
|
|
44
|
+
platform: "browser",
|
|
45
|
+
sourcemap: true,
|
|
46
|
+
logLevel: "error"
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* index file for project
|
|
52
|
+
*/
|
|
53
|
+
addDefaultIndex({
|
|
54
|
+
distFolder: "dist_client",
|
|
55
|
+
entry: "./index.js",
|
|
56
|
+
publicFolders:[],
|
|
57
|
+
hbr: true,
|
|
58
|
+
webSocketPort: 8080,
|
|
59
|
+
userInjectOnHbr:
|
|
60
|
+
'window.dispatchEvent(new CustomEvent("SIMPLE_HTML_SAVE_STATE"));',
|
|
61
|
+
indexTemplate: /*html*/ `<!DOCTYPE html>
|
|
62
|
+
<html lang="en">
|
|
63
|
+
<head>
|
|
64
|
+
<meta charset="UTF-8" />
|
|
65
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
66
|
+
<title>Document</title>
|
|
67
|
+
<link href="./index.css" rel="stylesheet" />
|
|
68
|
+
|
|
69
|
+
$bundle
|
|
70
|
+
</head>
|
|
71
|
+
<body>
|
|
72
|
+
</body>
|
|
73
|
+
</html>
|
|
74
|
+
`,
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* electron bundle
|
|
79
|
+
*/
|
|
80
|
+
electron(
|
|
81
|
+
{ watch: "./src_electron_main/**/*.ts", launch: true },
|
|
82
|
+
{
|
|
83
|
+
color: true,
|
|
84
|
+
define: {
|
|
85
|
+
DEVELOPMENT: "true",
|
|
86
|
+
},
|
|
87
|
+
entryPoints: ["./src_electron_main/index.ts"],
|
|
88
|
+
outfile: "./dist_electron_main/index.js",
|
|
89
|
+
minify: false,
|
|
90
|
+
target: "node14",
|
|
91
|
+
bundle: true,
|
|
92
|
+
plugins: [makeAllPackagesExternalPlugin],
|
|
93
|
+
platform: "node",
|
|
94
|
+
sourcemap: true,
|
|
95
|
+
logLevel: "error"
|
|
96
|
+
}
|
|
97
|
+
);
|