create-blocklet 0.4.16 → 0.4.19
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/README.md +4 -0
- package/package.json +5 -5
- package/templates/solidjs-dapp/index.html +0 -1
- package/templates/solidjs-dapp/package.json +2 -2
- package/templates/solidjs-dapp/vite.config.js +4 -18
- package/templates/solidjs-static/index.html +0 -1
- package/templates/solidjs-static/package.json +2 -2
- package/templates/solidjs-static/vite.config.js +2 -18
- package/templates/svelte-dapp/index.html +1 -2
- package/templates/svelte-dapp/package.json +2 -2
- package/templates/svelte-dapp/vite.config.js +2 -16
- package/templates/svelte-static/index.html +1 -2
- package/templates/svelte-static/package.json +2 -2
- package/templates/svelte-static/vite.config.js +2 -18
- package/templates/vue-dapp/index.html +1 -2
- package/templates/vue-dapp/package.json +2 -2
- package/templates/vue-dapp/vite.config.js +2 -17
- package/templates/vue-static/index.html +1 -2
- package/templates/vue-static/package.json +2 -2
- package/templates/vue-static/vite.config.js +2 -18
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-blocklet",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.19",
|
|
4
4
|
"exports": "./index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": "git@github.com:blocklet/create-blocklet.git",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
},
|
|
24
24
|
"homepage": "https://github.com/blocklet/create-blocklet/tree/main#readme",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@arcblock/did": "^1.17.
|
|
27
|
-
"@ocap/mcrypto": "^1.17.
|
|
28
|
-
"@ocap/util": "^1.17.
|
|
26
|
+
"@arcblock/did": "^1.17.4",
|
|
27
|
+
"@ocap/mcrypto": "^1.17.4",
|
|
28
|
+
"@ocap/util": "^1.17.4",
|
|
29
29
|
"boxen": "^6.2.1",
|
|
30
30
|
"ejs": "^3.1.8",
|
|
31
31
|
"envfile": "^6.17.0",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@arcblock/eslint-config-base": "0.2.2",
|
|
44
44
|
"eslint": "^8.19.0",
|
|
45
45
|
"prettier": "^2.7.1",
|
|
46
|
-
"vitest": "^0.
|
|
46
|
+
"vitest": "^0.18.0"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"lint": "eslint .",
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
<meta name="theme-color" content="#000000" />
|
|
7
7
|
<link rel="shortcut icon" type="image/ico" href="/src/assets/favicon.ico" />
|
|
8
8
|
<title><%- title %></title>
|
|
9
|
-
<script src="__meta__.js"></script>
|
|
10
9
|
</head>
|
|
11
10
|
<body>
|
|
12
11
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"start:api": "NODE_ENV=development nodemon api/index.js -w api",
|
|
11
11
|
"clean": "rm -rf .blocklet",
|
|
12
12
|
"bundle": "npm run bundle:client && npm run bundle:api",
|
|
13
|
-
"bundle:client": "vite build
|
|
13
|
+
"bundle:client": "vite build",
|
|
14
14
|
"bundle:api": "npm run clean && blocklet bundle --zip --create-release",
|
|
15
15
|
"deploy": "npm run bundle && blocklet deploy .blocklet/bundle",
|
|
16
16
|
"upload": "npm run bundle && blocklet upload .blocklet/release/blocklet.json",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"vite": "^2.9.14",
|
|
33
33
|
"vite-plugin-html": "^3.2.0",
|
|
34
34
|
"vite-plugin-solid": "^2.2.6",
|
|
35
|
-
"vite-plugin-
|
|
35
|
+
"vite-plugin-blocklet": "^0.4.19"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@arcblock/did-auth": "^1.17.4",
|
|
@@ -1,47 +1,33 @@
|
|
|
1
1
|
import { defineConfig, loadEnv } from 'vite';
|
|
2
2
|
import solidPlugin from 'vite-plugin-solid';
|
|
3
3
|
import { createHtmlPlugin } from 'vite-plugin-html';
|
|
4
|
-
import
|
|
4
|
+
import { createBlockletPlugin } from 'vite-plugin-blocklet';
|
|
5
5
|
|
|
6
6
|
export default defineConfig(async ({ mode }) => {
|
|
7
7
|
const envMap = loadEnv(mode, process.cwd(), '');
|
|
8
|
-
const port = process.env.BLOCKLET_PORT || 3000;
|
|
9
8
|
const apiPort = envMap.API_PORT || 3030;
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
let mountPoint = process.env.BLOCKLET_DEV_MOUNT_POINT || '';
|
|
14
|
-
|
|
15
|
-
if (mountPoint && !mountPoint.endsWith('/')) {
|
|
16
|
-
mountPoint = `${mountPoint}/`;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const base = whenDev ? mountPoint : process.env.BASE_URL || '/';
|
|
20
|
-
|
|
21
|
-
return defineConfig({
|
|
22
|
-
base,
|
|
10
|
+
return {
|
|
23
11
|
plugins: [
|
|
24
12
|
solidPlugin(),
|
|
25
13
|
createHtmlPlugin({
|
|
26
14
|
minify: true,
|
|
27
15
|
inject: {
|
|
28
16
|
data: {
|
|
29
|
-
base,
|
|
30
17
|
title: envMap.APP_TITLE,
|
|
31
18
|
},
|
|
32
19
|
},
|
|
33
20
|
}),
|
|
34
|
-
|
|
21
|
+
createBlockletPlugin(),
|
|
35
22
|
],
|
|
36
23
|
build: {
|
|
37
24
|
target: 'esnext',
|
|
38
25
|
polyfillDynamicImport: false,
|
|
39
26
|
},
|
|
40
27
|
server: {
|
|
41
|
-
port,
|
|
42
28
|
proxy: {
|
|
43
29
|
'/api': `http://127.0.0.1:${apiPort}`,
|
|
44
30
|
},
|
|
45
31
|
},
|
|
46
|
-
}
|
|
32
|
+
};
|
|
47
33
|
});
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
<meta name="theme-color" content="#000000" />
|
|
7
7
|
<link rel="shortcut icon" type="image/ico" href="/src/assets/favicon.ico" />
|
|
8
8
|
<title><%- title %></title>
|
|
9
|
-
<script src="__meta__.js"></script>
|
|
10
9
|
</head>
|
|
11
10
|
<body>
|
|
12
11
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"lint:fix": "npm run lint -- --fix",
|
|
10
10
|
"serve": "vite preview",
|
|
11
11
|
"clean": "rm -rf .blocklet",
|
|
12
|
-
"bundle": "npm run clean && vite build
|
|
12
|
+
"bundle": "npm run clean && vite build && blocklet bundle --zip --create-release",
|
|
13
13
|
"deploy": "npm run bundle && blocklet deploy .blocklet/bundle",
|
|
14
14
|
"upload": "npm run bundle && blocklet upload .blocklet/release/blocklet.json",
|
|
15
15
|
"prepare": "husky install"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"vite": "^2.9.14",
|
|
27
27
|
"vite-plugin-html": "^3.2.0",
|
|
28
28
|
"vite-plugin-solid": "^2.2.6",
|
|
29
|
-
"vite-plugin-
|
|
29
|
+
"vite-plugin-blocklet": "^0.4.19"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"solid-js": "^1.4.7"
|
|
@@ -1,43 +1,27 @@
|
|
|
1
1
|
import { defineConfig, loadEnv } from 'vite';
|
|
2
2
|
import solidPlugin from 'vite-plugin-solid';
|
|
3
3
|
import { createHtmlPlugin } from 'vite-plugin-html';
|
|
4
|
-
import
|
|
4
|
+
import { createBlockletPlugin } from 'vite-plugin-blocklet';
|
|
5
5
|
|
|
6
6
|
export default defineConfig(async ({ mode }) => {
|
|
7
7
|
const envMap = loadEnv(mode, process.cwd(), '');
|
|
8
|
-
const port = process.env.BLOCKLET_PORT || 3000;
|
|
9
|
-
|
|
10
|
-
const whenDev = mode === 'development';
|
|
11
|
-
|
|
12
|
-
let mountPoint = process.env.BLOCKLET_DEV_MOUNT_POINT || '';
|
|
13
|
-
|
|
14
|
-
if (mountPoint && !mountPoint.endsWith('/')) {
|
|
15
|
-
mountPoint = `${mountPoint}/`;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const base = whenDev ? mountPoint : process.env.BASE_URL || '/';
|
|
19
8
|
|
|
20
9
|
return {
|
|
21
|
-
base,
|
|
22
10
|
plugins: [
|
|
23
11
|
solidPlugin(),
|
|
24
12
|
createHtmlPlugin({
|
|
25
13
|
minify: true,
|
|
26
14
|
inject: {
|
|
27
15
|
data: {
|
|
28
|
-
base,
|
|
29
16
|
title: envMap.APP_TITLE,
|
|
30
17
|
},
|
|
31
18
|
},
|
|
32
19
|
}),
|
|
33
|
-
|
|
20
|
+
createBlockletPlugin(),
|
|
34
21
|
],
|
|
35
22
|
build: {
|
|
36
23
|
target: 'esnext',
|
|
37
24
|
polyfillDynamicImport: false,
|
|
38
25
|
},
|
|
39
|
-
server: {
|
|
40
|
-
port,
|
|
41
|
-
},
|
|
42
26
|
};
|
|
43
27
|
});
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" href="
|
|
5
|
+
<link rel="icon" href="/favicon.ico" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
|
|
7
7
|
<meta name="theme-color" content="#4F6AF5" />
|
|
8
8
|
<meta name="description" content="Web site created using create-blocklet" />
|
|
9
9
|
<title><%- title %></title>
|
|
10
|
-
<script src="__meta__.js"></script>
|
|
11
10
|
</head>
|
|
12
11
|
<body>
|
|
13
12
|
<div id="app"></div>
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"start:api": "NODE_ENV=development nodemon api/index.js -w api",
|
|
11
11
|
"clean": "rm -rf .blocklet",
|
|
12
12
|
"bundle": "npm run bundle:client && npm run bundle:api",
|
|
13
|
-
"bundle:client": "vite build
|
|
13
|
+
"bundle:client": "vite build",
|
|
14
14
|
"bundle:api": "npm run clean && blocklet bundle --zip --create-release",
|
|
15
15
|
"deploy": "npm run bundle && blocklet deploy .blocklet/bundle",
|
|
16
16
|
"upload": "npm run bundle && blocklet upload .blocklet/release/blocklet.json",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"svelte": "^3.49.0",
|
|
45
45
|
"vite": "^2.9.14",
|
|
46
46
|
"vite-plugin-html": "^3.2.0",
|
|
47
|
-
"vite-plugin-
|
|
47
|
+
"vite-plugin-blocklet": "^0.4.19"
|
|
48
48
|
},
|
|
49
49
|
"lint-staged": {
|
|
50
50
|
"*.{mjs,js,vue}": [
|
|
@@ -1,41 +1,27 @@
|
|
|
1
1
|
import { defineConfig, loadEnv } from 'vite';
|
|
2
2
|
import { svelte } from '@sveltejs/vite-plugin-svelte';
|
|
3
3
|
import { createHtmlPlugin } from 'vite-plugin-html';
|
|
4
|
-
import
|
|
4
|
+
import { createBlockletPlugin } from 'vite-plugin-blocklet';
|
|
5
5
|
|
|
6
6
|
// https://vitejs.dev/config/
|
|
7
7
|
export default defineConfig(async ({ mode }) => {
|
|
8
8
|
const envMap = loadEnv(mode, process.cwd(), '');
|
|
9
|
-
const port = process.env.BLOCKLET_PORT || 3000;
|
|
10
9
|
const apiPort = envMap.API_PORT || 3030;
|
|
11
10
|
|
|
12
|
-
const whenDev = mode === 'development';
|
|
13
|
-
|
|
14
|
-
let mountPoint = process.env.BLOCKLET_DEV_MOUNT_POINT || '';
|
|
15
|
-
|
|
16
|
-
if (mountPoint && !mountPoint.endsWith('/')) {
|
|
17
|
-
mountPoint = `${mountPoint}/`;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const base = whenDev ? mountPoint : process.env.BASE_URL || '/';
|
|
21
|
-
|
|
22
11
|
return {
|
|
23
|
-
base,
|
|
24
12
|
plugins: [
|
|
25
13
|
svelte(),
|
|
26
14
|
createHtmlPlugin({
|
|
27
15
|
minify: true,
|
|
28
16
|
inject: {
|
|
29
17
|
data: {
|
|
30
|
-
base,
|
|
31
18
|
title: envMap.APP_TITLE,
|
|
32
19
|
},
|
|
33
20
|
},
|
|
34
21
|
}),
|
|
35
|
-
|
|
22
|
+
createBlockletPlugin(),
|
|
36
23
|
],
|
|
37
24
|
server: {
|
|
38
|
-
port,
|
|
39
25
|
proxy: {
|
|
40
26
|
'/api': `http://127.0.0.1:${apiPort}`,
|
|
41
27
|
},
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" href="
|
|
5
|
+
<link rel="icon" href="/favicon.ico" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
|
|
7
7
|
<meta name="theme-color" content="#4F6AF5" />
|
|
8
8
|
<meta name="description" content="Web site created using create-blocklet" />
|
|
9
9
|
<title><%- title %></title>
|
|
10
|
-
<script src="__meta__.js"></script>
|
|
11
10
|
</head>
|
|
12
11
|
<body>
|
|
13
12
|
<div id="app"></div>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"lint": "eslint src --ext .mjs,.js,.svelte",
|
|
10
10
|
"lint:fix": "npm run lint -- --fix",
|
|
11
11
|
"clean": "rm -rf .blocklet",
|
|
12
|
-
"bundle": "npm run clean && vite build
|
|
12
|
+
"bundle": "npm run clean && vite build && blocklet bundle --zip --create-release",
|
|
13
13
|
"deploy": "npm run bundle && blocklet deploy .blocklet/bundle",
|
|
14
14
|
"upload": "npm run bundle && blocklet upload .blocklet/release/blocklet.json",
|
|
15
15
|
"prepare": "husky install"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"svelte": "^3.49.0",
|
|
27
27
|
"vite": "^2.9.14",
|
|
28
28
|
"vite-plugin-html": "^3.2.0",
|
|
29
|
-
"vite-plugin-
|
|
29
|
+
"vite-plugin-blocklet": "^0.4.19"
|
|
30
30
|
},
|
|
31
31
|
"lint-staged": {
|
|
32
32
|
"*.{mjs,js,vue}": [
|
|
@@ -1,40 +1,24 @@
|
|
|
1
1
|
import { defineConfig, loadEnv } from 'vite';
|
|
2
2
|
import { svelte } from '@sveltejs/vite-plugin-svelte';
|
|
3
3
|
import { createHtmlPlugin } from 'vite-plugin-html';
|
|
4
|
-
import
|
|
4
|
+
import { createBlockletPlugin } from 'vite-plugin-blocklet';
|
|
5
5
|
|
|
6
6
|
// https://vitejs.dev/config/
|
|
7
7
|
export default defineConfig(async ({ mode }) => {
|
|
8
8
|
const envMap = loadEnv(mode, process.cwd(), '');
|
|
9
|
-
const port = process.env.BLOCKLET_PORT || 3000;
|
|
10
|
-
|
|
11
|
-
const whenDev = mode === 'development';
|
|
12
|
-
|
|
13
|
-
let mountPoint = process.env.BLOCKLET_DEV_MOUNT_POINT || '';
|
|
14
|
-
|
|
15
|
-
if (mountPoint && !mountPoint.endsWith('/')) {
|
|
16
|
-
mountPoint = `${mountPoint}/`;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const base = whenDev ? mountPoint : process.env.BASE_URL || '/';
|
|
20
9
|
|
|
21
10
|
return {
|
|
22
|
-
base,
|
|
23
11
|
plugins: [
|
|
24
12
|
svelte(),
|
|
25
13
|
createHtmlPlugin({
|
|
26
14
|
minify: true,
|
|
27
15
|
inject: {
|
|
28
16
|
data: {
|
|
29
|
-
base,
|
|
30
17
|
title: envMap.APP_TITLE,
|
|
31
18
|
},
|
|
32
19
|
},
|
|
33
20
|
}),
|
|
34
|
-
|
|
21
|
+
createBlockletPlugin(),
|
|
35
22
|
],
|
|
36
|
-
server: {
|
|
37
|
-
port,
|
|
38
|
-
},
|
|
39
23
|
};
|
|
40
24
|
});
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" href="
|
|
5
|
+
<link rel="icon" href="/favicon.ico" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
|
|
7
7
|
<meta name="theme-color" content="#4F6AF5" />
|
|
8
8
|
<meta name="description" content="Web site created using create-blocklet" />
|
|
9
9
|
<title><%- title %></title>
|
|
10
|
-
<script src="__meta__.js"></script>
|
|
11
10
|
</head>
|
|
12
11
|
<body>
|
|
13
12
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"start:api": "NODE_ENV=development nodemon api/index.js -w api",
|
|
10
10
|
"clean": "rm -rf .blocklet",
|
|
11
11
|
"bundle": "npm run bundle:client && npm run bundle:api",
|
|
12
|
-
"bundle:client": "vite build
|
|
12
|
+
"bundle:client": "vite build",
|
|
13
13
|
"bundle:api": "npm run clean && blocklet bundle --zip --create-release",
|
|
14
14
|
"deploy": "npm run bundle && blocklet deploy .blocklet/bundle",
|
|
15
15
|
"upload": "npm run bundle && blocklet upload .blocklet/release/blocklet.json",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"npm-run-all": "^4.1.5",
|
|
48
48
|
"prettier": "^2.7.1",
|
|
49
49
|
"vite": "^2.9.14",
|
|
50
|
-
"vite-plugin-
|
|
50
|
+
"vite-plugin-blocklet": "^0.4.19"
|
|
51
51
|
},
|
|
52
52
|
"lint-staged": {
|
|
53
53
|
"*.{mjs,js,vue}": [
|
|
@@ -1,42 +1,27 @@
|
|
|
1
1
|
import { defineConfig, loadEnv } from 'vite';
|
|
2
2
|
import vue from '@vitejs/plugin-vue';
|
|
3
3
|
import { createHtmlPlugin } from 'vite-plugin-html';
|
|
4
|
-
import
|
|
4
|
+
import { createBlockletPlugin } from 'vite-plugin-blocklet';
|
|
5
5
|
|
|
6
6
|
// https://vitejs.dev/config/
|
|
7
7
|
export default defineConfig(async ({ mode }) => {
|
|
8
8
|
const envMap = loadEnv(mode, process.cwd(), '');
|
|
9
9
|
const apiPort = envMap.API_PORT || 3030;
|
|
10
10
|
|
|
11
|
-
const port = process.env.BLOCKLET_PORT || 3000;
|
|
12
|
-
|
|
13
|
-
const whenDev = mode === 'development';
|
|
14
|
-
|
|
15
|
-
let mountPoint = process.env.BLOCKLET_DEV_MOUNT_POINT || '';
|
|
16
|
-
|
|
17
|
-
if (mountPoint && !mountPoint.endsWith('/')) {
|
|
18
|
-
mountPoint = `${mountPoint}/`;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const base = whenDev ? mountPoint : process.env.BASE_URL || '/';
|
|
22
|
-
|
|
23
11
|
return {
|
|
24
|
-
base,
|
|
25
12
|
plugins: [
|
|
26
13
|
vue(),
|
|
27
14
|
createHtmlPlugin({
|
|
28
15
|
minify: true,
|
|
29
16
|
inject: {
|
|
30
17
|
data: {
|
|
31
|
-
base,
|
|
32
18
|
title: envMap.APP_TITLE,
|
|
33
19
|
},
|
|
34
20
|
},
|
|
35
21
|
}),
|
|
36
|
-
|
|
22
|
+
createBlockletPlugin(),
|
|
37
23
|
],
|
|
38
24
|
server: {
|
|
39
|
-
port,
|
|
40
25
|
proxy: {
|
|
41
26
|
'/api': `http://127.0.0.1:${apiPort}`,
|
|
42
27
|
},
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" href="
|
|
5
|
+
<link rel="icon" href="/favicon.ico" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
|
|
7
7
|
<meta name="theme-color" content="#4F6AF5" />
|
|
8
8
|
<meta name="description" content="Web site created using create-blocklet" />
|
|
9
9
|
<title><%- title %></title>
|
|
10
|
-
<script src="__meta__.js"></script>
|
|
11
10
|
</head>
|
|
12
11
|
<body>
|
|
13
12
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"lint:fix": "npm run lint -- --fix",
|
|
9
9
|
"serve": "vite preview",
|
|
10
10
|
"clean": "rm -rf .blocklet",
|
|
11
|
-
"bundle": "npm run clean && vite build
|
|
11
|
+
"bundle": "npm run clean && vite build && blocklet bundle --zip --create-release",
|
|
12
12
|
"deploy": "npm run bundle && blocklet deploy .blocklet/bundle",
|
|
13
13
|
"upload": "npm run bundle && blocklet upload .blocklet/release/blocklet.json",
|
|
14
14
|
"prepare": "husky install"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"prettier": "^2.7.1",
|
|
28
28
|
"vite": "^2.9.14",
|
|
29
29
|
"vite-plugin-html": "^3.2.0",
|
|
30
|
-
"vite-plugin-
|
|
30
|
+
"vite-plugin-blocklet": "^0.4.19"
|
|
31
31
|
},
|
|
32
32
|
"lint-staged": {
|
|
33
33
|
"*.{mjs,js,vue}": [
|
|
@@ -1,40 +1,24 @@
|
|
|
1
1
|
import { defineConfig, loadEnv } from 'vite';
|
|
2
2
|
import vue from '@vitejs/plugin-vue';
|
|
3
3
|
import { createHtmlPlugin } from 'vite-plugin-html';
|
|
4
|
-
import
|
|
4
|
+
import { createBlockletPlugin } from 'vite-plugin-blocklet';
|
|
5
5
|
|
|
6
6
|
// https://vitejs.dev/config/
|
|
7
7
|
export default defineConfig(async ({ mode }) => {
|
|
8
8
|
const envMap = loadEnv(mode, process.cwd(), '');
|
|
9
|
-
const port = process.env.BLOCKLET_PORT || 3000;
|
|
10
|
-
|
|
11
|
-
const whenDev = mode === 'development';
|
|
12
|
-
|
|
13
|
-
let mountPoint = process.env.BLOCKLET_DEV_MOUNT_POINT || '';
|
|
14
|
-
|
|
15
|
-
if (mountPoint && !mountPoint.endsWith('/')) {
|
|
16
|
-
mountPoint = `${mountPoint}/`;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const base = whenDev ? mountPoint : process.env.BASE_URL || '/';
|
|
20
9
|
|
|
21
10
|
return {
|
|
22
|
-
base,
|
|
23
11
|
plugins: [
|
|
24
12
|
vue(),
|
|
25
13
|
createHtmlPlugin({
|
|
26
14
|
minify: true,
|
|
27
15
|
inject: {
|
|
28
16
|
data: {
|
|
29
|
-
base,
|
|
30
17
|
title: envMap.APP_TITLE,
|
|
31
18
|
},
|
|
32
19
|
},
|
|
33
20
|
}),
|
|
34
|
-
|
|
21
|
+
createBlockletPlugin(),
|
|
35
22
|
],
|
|
36
|
-
server: {
|
|
37
|
-
port,
|
|
38
|
-
},
|
|
39
23
|
};
|
|
40
24
|
});
|