@tmsfe/tmskit 0.0.7 → 0.0.8

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.
Files changed (46) hide show
  1. package/README.md +27 -27
  2. package/dist/index.cjs.js +1284 -983
  3. package/package.json +73 -75
  4. package/src/{gulp → compile}/build.js +5 -5
  5. package/src/{gulp → compile}/compile.js +90 -81
  6. package/src/{gulp → compile}/dev.js +129 -102
  7. package/src/{gulp → compile}/plugins/less.js +116 -116
  8. package/src/{gulp → compile}/plugins/mpCommonDep.js +131 -131
  9. package/src/{gulp → compile}/plugins/mpJsonDep.js +112 -108
  10. package/src/{gulp → compile}/plugins/mpWxmlDep.js +194 -194
  11. package/src/{gulp → compile}/plugins/postcss-font-base64.js +72 -72
  12. package/src/{gulp → compile}/plugins/replaceEnv.js +29 -29
  13. package/src/{gulp → compile}/plugins/utils/pluginError.js +25 -25
  14. package/src/config/constant.js +69 -71
  15. package/src/config/defaultTmsConfig.js +16 -16
  16. package/src/{utils → core}/buildAppJson.js +166 -221
  17. package/src/{utils → core}/checkDependencies.js +77 -77
  18. package/src/core/cloneModules.js +203 -0
  19. package/src/{utils → core}/handleError.js +18 -16
  20. package/src/core/isInIt.js +69 -0
  21. package/src/{utils/mpCiUtils.js → core/mpCi.js} +73 -73
  22. package/src/core/npm.js +218 -0
  23. package/src/core/symbolicLink.js +24 -0
  24. package/src/{utils/tkitUtils.js → core/tmsMpconfig.js} +234 -158
  25. package/src/entry.js +62 -60
  26. package/src/index.js +63 -62
  27. package/src/init.js +33 -33
  28. package/src/scripts/create/ask.js +63 -63
  29. package/src/scripts/create/generator.js +25 -25
  30. package/src/scripts/create/ignoreFiles.js +7 -7
  31. package/src/scripts/create/index.js +72 -72
  32. package/src/scripts/create/render.js +19 -19
  33. package/src/scripts/run/build/index.js +16 -17
  34. package/src/scripts/run/dev/index.js +42 -84
  35. package/src/scripts/run/index.js +97 -68
  36. package/src/scripts/run/init/index.js +95 -87
  37. package/src/scripts/run/install/index.js +31 -29
  38. package/src/utils/findCssImport.js +30 -30
  39. package/src/utils/global.js +22 -36
  40. package/src/utils/io.js +107 -106
  41. package/src/utils/log.js +47 -44
  42. package/src/utils/widgets.js +178 -167
  43. package/main.js +0 -3
  44. package/src/utils/cliUtils.js +0 -35
  45. package/src/utils/cloneModules.js +0 -116
  46. package/src/utils/npmUtils.js +0 -166
package/package.json CHANGED
@@ -1,75 +1,73 @@
1
- {
2
- "name": "@tmsfe/tmskit",
3
- "version": "0.0.7",
4
- "description": "tmskit",
5
- "main": "main.js",
6
- "bin": {
7
- "tmskit": "main.js"
8
- },
9
- "files": [
10
- "src",
11
- "dist",
12
- "main.js",
13
- "package.json"
14
- ],
15
- "scripts": {
16
- "dev": "rollup -wc --environment TARGET:tmskit",
17
- "build": "rollup -c --environment TARGET:tmskit"
18
- },
19
- "author": "tms·web",
20
- "license": "ISC",
21
- "buildOptions": {
22
- "formats": [
23
- "cjs"
24
- ]
25
- },
26
- "devDependencies": {
27
- "@rollup/plugin-babel": "^5.0.2",
28
- "@rollup/plugin-commonjs": "^19.0.0",
29
- "@rollup/plugin-dynamic-import-vars": "^1.1.1",
30
- "@rollup/plugin-json": "^4.0.3",
31
- "rollup": "^2.6.1",
32
- "rollup-plugin-node-resolve": "^5.2.0",
33
- "rollup-plugin-replace": "^2.2.0",
34
- "rollup-plugin-terser": "^6.1.0",
35
- "rollup-plugin-typescript2": "0.27.0"
36
- },
37
- "dependencies": {
38
- "async": "^3.2.2",
39
- "chalk": "^4.1.0",
40
- "commander": "^8.3.0",
41
- "copy-webpack-plugin": "^9.1.0",
42
- "download-git-repo": "^3.0.2",
43
- "ejs": "^3.1.5",
44
- "fs-extra": "^10.0.1",
45
- "glob-ignore": "^1.0.2",
46
- "gulp": "^4.0.2",
47
- "gulp-cache": "^1.1.3",
48
- "gulp-image": "^5.1.0",
49
- "gulp-postcss": "^9.0.1",
50
- "gulp-px-to-rpx": "^1.0.7",
51
- "gulp-watch": "^5.0.1",
52
- "htmlparser2": "^7.2.0",
53
- "inquirer": "^7.3.3",
54
- "leven": "3.1.0",
55
- "lodash": "^4.17.21",
56
- "metalsmith": "^2.3.0",
57
- "miniprogram-ci": "1.4.13",
58
- "object-assign": "^4.0.1",
59
- "ora": "^5.1.0",
60
- "plugin-error": "^1.0.0",
61
- "postcss": "^8.4.6",
62
- "precinct": "^8.3.1",
63
- "replace-ext": "^2.0.0",
64
- "shelljs": "^0.8.4",
65
- "strip-comments": "^2.0.1",
66
- "through2": "^4.0.2",
67
- "vinyl-sourcemaps-apply": "^0.2.0"
68
- },
69
- "engines": {
70
- "node": "^12.17.0 || >= 14.13.1"
71
- },
72
- "jest": {
73
- "testEnvironment": "jest-environment-node"
74
- }
75
- }
1
+ {
2
+ "name": "@tmsfe/tmskit",
3
+ "version": "0.0.8",
4
+ "description": "tmskit",
5
+ "main": "dist/index.cjs",
6
+ "bin": {
7
+ "tmskit": "main.js"
8
+ },
9
+ "files": [
10
+ "src",
11
+ "dist",
12
+ "main.js",
13
+ "package.json"
14
+ ],
15
+ "scripts": {
16
+ "dev": "rollup -wc --environment TARGET:tmskit",
17
+ "build": "rollup -c --environment TARGET:tmskit"
18
+ },
19
+ "author": "tms·web",
20
+ "license": "ISC",
21
+ "buildOptions": {
22
+ "formats": [
23
+ "cjs"
24
+ ]
25
+ },
26
+ "devDependencies": {
27
+ "@rollup/plugin-babel": "^5.0.2",
28
+ "@rollup/plugin-commonjs": "^19.0.0",
29
+ "@rollup/plugin-dynamic-import-vars": "^1.1.1",
30
+ "@rollup/plugin-json": "^4.0.3",
31
+ "rollup": "^2.6.1",
32
+ "rollup-plugin-node-resolve": "^5.2.0",
33
+ "rollup-plugin-replace": "^2.2.0",
34
+ "rollup-plugin-terser": "^6.1.0",
35
+ "rollup-plugin-typescript2": "0.27.0"
36
+ },
37
+ "dependencies": {
38
+ "async": "^3.2.2",
39
+ "chalk": "^4.1.0",
40
+ "commander": "^8.3.0",
41
+ "copy-webpack-plugin": "^9.1.0",
42
+ "ejs": "^3.1.5",
43
+ "fs-extra": "^10.0.1",
44
+ "glob-ignore": "^1.0.2",
45
+ "gulp": "^4.0.2",
46
+ "gulp-cache": "^1.1.3",
47
+ "gulp-postcss": "^9.0.1",
48
+ "gulp-px-to-rpx": "^1.0.7",
49
+ "gulp-watch": "^5.0.1",
50
+ "htmlparser2": "^7.2.0",
51
+ "inquirer": "^7.3.3",
52
+ "leven": "3.1.0",
53
+ "lodash": "^4.17.21",
54
+ "metalsmith": "^2.3.0",
55
+ "miniprogram-ci": "1.4.13",
56
+ "object-assign": "^4.0.1",
57
+ "ora": "^5.1.0",
58
+ "plugin-error": "^1.0.0",
59
+ "postcss": "^8.4.6",
60
+ "precinct": "^8.3.1",
61
+ "replace-ext": "^2.0.0",
62
+ "shelljs": "^0.8.4",
63
+ "strip-comments": "^2.0.1",
64
+ "through2": "^4.0.2",
65
+ "vinyl-sourcemaps-apply": "^0.2.0"
66
+ },
67
+ "engines": {
68
+ "node": "^12.17.0 || >= 14.13.1"
69
+ },
70
+ "jest": {
71
+ "testEnvironment": "jest-environment-node"
72
+ }
73
+ }
@@ -1,5 +1,5 @@
1
- const dev = require('./dev');
2
-
3
- module.exports = async (tmsConfig, newModules) => {
4
- dev(tmsConfig, newModules, false);
5
- };
1
+ const dev = require('./dev');
2
+
3
+ module.exports = async (tmsConfig, newModules) => {
4
+ dev(tmsConfig, newModules, false);
5
+ };
@@ -1,81 +1,90 @@
1
- const { src, dest, lastRun } = require('gulp');
2
- const px2rpx = require('gulp-px-to-rpx');
3
- const watch = require('gulp-watch');
4
- // const cache = require('gulp-cache');
5
- // const image = require('gulp-image');
6
- const replaceEnv = require('./plugins/replaceEnv');
7
- const { mpCommonDep } = require('./plugins/mpCommonDep');
8
- const { mpJsonDep } = require('./plugins/mpJsonDep');
9
- const { mpWxmlDep } = require('./plugins/mpWxmlDep');
10
- const { fail } = require('../utils/log');
11
-
12
- const since = task => file => (lastRun(task) > file.stat.ctime ? lastRun(task) : 0);
13
- module.exports = function (
14
- tmsConfig,
15
- {
16
- glob,
17
- destPath,
18
- srcOption,
19
- module,
20
- watchOption = { events: ['change', 'add', 'unlink'] },
21
- isWatch,
22
- },
23
- ) {
24
- Object.keys(glob).forEach((globKey) => {
25
- const globValue = glob[globKey];
26
- const task = () => src(globValue, { ...srcOption, since: since(task) });
27
- let srcPipe = task();
28
-
29
- if (isWatch) {
30
- srcPipe = srcPipe.pipe(watch(globValue, watchOption));
31
- }
32
-
33
- switch (globKey) {
34
- case 'js':
35
- srcPipe
36
- .pipe(replaceEnv(/process\.env(\.(\w*))?/g, tmsConfig.envData))
37
- .pipe(mpCommonDep(tmsConfig, module, ['.js', '.ts', '.wxs', '.json'], isWatch))
38
- .pipe(dest(destPath))
39
- .on('error', (err) => {
40
- fail(`js编译报错${err}`);
41
- });
42
- break;
43
- case 'wxss':
44
- srcPipe
45
- .pipe(mpCommonDep(tmsConfig, module, ['.wxss', '.less'], isWatch))
46
- .pipe(px2rpx({
47
- designWidth: 375, // 设计稿宽度,默认为750
48
- precision: 2, // 小数最大精度,默认为6
49
- }))
50
- .pipe(dest(destPath));
51
- break;
52
- case 'json':
53
- srcPipe
54
- .pipe(mpJsonDep(tmsConfig, module, ['.json'], ['.wxml', '.json', '.js', '.ts', '.wxss', '.less'], isWatch))
55
- .on('error', (err) => {
56
- fail(`json编译报错${err}`);
57
- })
58
- .pipe(dest(destPath));
59
- break;
60
- case 'wxml':
61
- srcPipe
62
- .pipe(mpWxmlDep(tmsConfig, module, isWatch))
63
- .pipe(dest(destPath));
64
- break;
65
- case 'image':
66
- srcPipe
67
- // .pipe(cache(image()))
68
- // .on('error', (err) => {
69
- // fail(`image编译报错${err}`);
70
- // })
71
- .pipe(dest(destPath));
72
- break;
73
- case 'other':
74
- srcPipe
75
- .pipe(dest(destPath));
76
- break;
77
- default:
78
- break;
79
- }
80
- });
81
- };
1
+ const { src, dest, lastRun } = require('gulp');
2
+ const px2rpx = require('gulp-px-to-rpx');
3
+ const watch = require('gulp-watch');
4
+ // const cache = require('gulp-cache');
5
+ // const image = require('gulp-image');
6
+ // const replaceEnv = require('./plugins/replaceEnv');
7
+ const { mpCommonDep } = require('./plugins/mpCommonDep');
8
+ const { mpJsonDep } = require('./plugins/mpJsonDep');
9
+ const { mpWxmlDep } = require('./plugins/mpWxmlDep');
10
+ // const postcss = require('gulp-postcss');
11
+ // const base64 = require('./plugins/postcss-font-base64');
12
+ const { fail } = require('../utils/log');
13
+
14
+ const since = task => file => (lastRun(task) > file.stat.ctime ? lastRun(task) : 0);
15
+ module.exports = function (
16
+ tmsConfig,
17
+ {
18
+ glob,
19
+ destPath,
20
+ srcOption,
21
+ module,
22
+ watchOption = { events: ['change', 'add', 'unlink'] },
23
+ isWatch,
24
+ },
25
+ ) {
26
+ Object.keys(glob).forEach((globKey) => {
27
+ const globValue = glob[globKey];
28
+ const task = () => src(globValue, { ...srcOption, since: since(task) });
29
+ let srcPipe = task();
30
+
31
+ if (isWatch) {
32
+ srcPipe = srcPipe.pipe(watch(globValue, watchOption));
33
+ }
34
+
35
+ switch (globKey) {
36
+ case 'js':
37
+ srcPipe
38
+ // .pipe(replaceEnv(/process\.env(\.(\w*))?/g, tmsConfig.envData))
39
+ .pipe(mpCommonDep(tmsConfig, module, ['.js', '.ts', '.wxs', '.json'], isWatch))
40
+ .pipe(dest(destPath))
41
+ .on('error', (err) => {
42
+ fail(`js编译报错${err}`);
43
+ });
44
+ break;
45
+ case 'wxss':
46
+ srcPipe
47
+ .pipe(mpCommonDep(tmsConfig, module, ['.wxss', '.less'], isWatch))
48
+ .on('error', (err) => {
49
+ fail(`mpCommonDep编译报错${err}`);
50
+ })
51
+ // .pipe(postcss([base64()]))
52
+ // .on('error', (err) => {
53
+ // fail(`postcss编译报错${err}`);
54
+ // })
55
+ .pipe(px2rpx({
56
+ designWidth: 375, // 设计稿宽度,默认为750
57
+ precision: 2, // 小数最大精度,默认为6
58
+ }))
59
+ .pipe(dest(destPath));
60
+ break;
61
+ case 'json':
62
+ srcPipe
63
+ .pipe(mpJsonDep(tmsConfig, module, ['.json'], ['.wxml', '.json', '.js', '.ts', '.wxss', '.less'], isWatch))
64
+ .on('error', (err) => {
65
+ fail(`mpJsonDep编译报错${err}`);
66
+ })
67
+ .pipe(dest(destPath));
68
+ break;
69
+ case 'wxml':
70
+ srcPipe
71
+ .pipe(mpWxmlDep(tmsConfig, module, isWatch))
72
+ .pipe(dest(destPath));
73
+ break;
74
+ case 'image':
75
+ srcPipe
76
+ // .pipe(cache(image()))
77
+ // .on('error', (err) => {
78
+ // fail(`image编译报错${err}`);
79
+ // })
80
+ .pipe(dest(destPath));
81
+ break;
82
+ case 'other':
83
+ srcPipe
84
+ .pipe(dest(destPath));
85
+ break;
86
+ default:
87
+ break;
88
+ }
89
+ });
90
+ };
@@ -1,102 +1,129 @@
1
- const watch = require('gulp-watch');
2
- const { resolve } = require('../utils/widgets');
3
- const { buildOutputAppJson } = require('../utils/buildAppJson');
4
- const { DEFAULT_COPY_CONFIG } = require('../config/constant');
5
- const compile = require('./compile');
6
-
7
- function excludeGlob(glob) {
8
- const otherArr = new Set();
9
- otherArr.add('!**/*.{ttf,otf,woff,eot}');
10
- Object.keys(glob).forEach((globKey) => {
11
- if (typeof glob[globKey] === 'string') {
12
- const data = glob[globKey].startsWith('!') ? glob[globKey] : `!${glob[globKey]}`;
13
- otherArr.add(data);
14
- } if (Array.isArray(glob[globKey])) {
15
- glob[globKey].forEach((value) => {
16
- if (typeof value === 'string') {
17
- const data = value.startsWith('!') ? value : `!${value}`;
18
- otherArr.add(data);
19
- }
20
- });
21
- }
22
- });
23
- return Array.from(otherArr);
24
- }
25
-
26
- module.exports = async (tmsConfig, newModules, isWatch = true) => {
27
- // 监听app.json
28
- if (isWatch) {
29
- watch(resolve('app.json'), { ignoreInitial: false, events: ['add', 'change'] }, () => {
30
- buildOutputAppJson(tmsConfig, newModules, isWatch);
31
- });
32
- } else {
33
- buildOutputAppJson(tmsConfig, newModules, isWatch);
34
- }
35
-
36
- // 监听根目录的文件
37
- compile(tmsConfig, {
38
- glob: {
39
- json: DEFAULT_COPY_CONFIG.map(item => resolve(item)),
40
- wxss: ['app.less', 'app.wxss'].map(item => resolve(item)),
41
- js: ['app.js', 'app.ts'].map(item => resolve(item)),
42
- },
43
- module: { from: '', to: '' },
44
- destPath: resolve(tmsConfig.outputDir),
45
- srcOption: { allowEmpty: true },
46
- isWatch,
47
- });
48
-
49
- // 监听模块的文件
50
- for (let module of newModules) {
51
- // 处理默认参数
52
- module = {
53
- ...{ exclude: [] },
54
- ...module,
55
- };
56
-
57
- if (isWatch) {
58
- // 监听模块配置文件
59
- watch(`${resolve(module.path)}/**/module.config.json`, { events: ['change'] }, () => {
60
- buildOutputAppJson(tmsConfig, newModules, isWatch);
61
- });
62
- }
63
-
64
- const excludes = module.exclude.map(key => `!${resolve(key)}`);
65
- const glob = {
66
- js: [`${resolve(module.path)}/**/*.{js,ts,wxs}`, ...excludes],
67
- json: [`${resolve(module.path)}/**/*.json`, ...excludes],
68
- wxss: [`${resolve(module.path)}/**/*.{less,wxss}`, ...excludes],
69
- wxml: [`${resolve(module.path)}/**/*.wxml`, ...excludes],
70
- image: [`${resolve(module.path)}/**/*.{png,jpg,jpeg,gif,svg}`, ...excludes],
71
- };
72
-
73
- compile(tmsConfig, {
74
- glob: {
75
- ...glob,
76
- other: [`${resolve(module.path)}/**/*`, ...excludeGlob(glob)],
77
- },
78
- destPath: resolve(tmsConfig.outputDir, module.root),
79
- module: { from: module.path, to: module.root },
80
- srcOption: { allowEmpty: true },
81
- isWatch,
82
- });
83
- }
84
-
85
- // 静态资源目录-拷贝
86
- if (tmsConfig?.static && tmsConfig?.static.length > 0) {
87
- for (const item of tmsConfig.static) {
88
- const from = item?.from.startsWith('/') ? item.from : resolve(item.from);
89
- const to = item?.to.startsWith('/') ? item.to : resolve(item.to);
90
-
91
- compile(tmsConfig, {
92
- glob: {
93
- other: [from],
94
- },
95
- destPath: to,
96
- module: item,
97
- srcOption: { allowEmpty: true },
98
- isWatch,
99
- });
100
- }
101
- }
102
- };
1
+ const path = require('path');
2
+ const fs = require('fs');
3
+ const watch = require('gulp-watch');
4
+ const { resolve } = require('../utils/widgets');
5
+ const { buildOutputAppJson } = require('../core/buildAppJson');
6
+ const { DEFAULT_COPY_CONFIG } = require('../config/constant');
7
+ const compile = require('./compile');
8
+
9
+ function excludeGlob(glob) {
10
+ const otherArr = new Set();
11
+ otherArr.add('!**/*.{ttf,otf,woff,eot}');
12
+ Object.keys(glob).forEach((globKey) => {
13
+ if (typeof glob[globKey] === 'string') {
14
+ const data = glob[globKey].startsWith('!') ? glob[globKey] : `!${glob[globKey]}`;
15
+ otherArr.add(data);
16
+ } if (Array.isArray(glob[globKey])) {
17
+ glob[globKey].forEach((value) => {
18
+ if (typeof value === 'string') {
19
+ const data = value.startsWith('!') ? value : `!${value}`;
20
+ otherArr.add(data);
21
+ }
22
+ });
23
+ }
24
+ });
25
+ return Array.from(otherArr);
26
+ }
27
+
28
+ function adaptPath(pathDir) {
29
+ let newPath = pathDir;
30
+ newPath = newPath.startsWith('/') ? newPath : resolve(newPath);
31
+ newPath = newPath.endsWith('/') ? newPath.slice(0, newPath.length - 1) : newPath;
32
+ return newPath;
33
+ }
34
+
35
+ module.exports = async (tmsConfig, newModules, isWatch = true) => {
36
+ // 监听app.json
37
+ if (isWatch) {
38
+ watch(resolve('app.json'), { ignoreInitial: false, events: ['add', 'change'] }, () => {
39
+ buildOutputAppJson(tmsConfig, newModules, isWatch);
40
+ });
41
+ } else {
42
+ buildOutputAppJson(tmsConfig, newModules, isWatch);
43
+ }
44
+
45
+ // 监听根目录的文件
46
+ compile(tmsConfig, {
47
+ glob: {
48
+ json: DEFAULT_COPY_CONFIG.map(item => resolve(item)),
49
+ // wxss: ['app.less', 'app.wxss'].map(item => resolve(item)),
50
+ // js: ['app.js', 'app.ts'].map(item => resolve(item)),
51
+ },
52
+ module: { from: '', to: '' },
53
+ destPath: resolve(tmsConfig.outputDir),
54
+ srcOption: { allowEmpty: true },
55
+ isWatch,
56
+ });
57
+
58
+ // 监听模块的文件
59
+ for (let module of newModules) {
60
+ // 处理默认参数
61
+ module = {
62
+ ...{ exclude: [] },
63
+ ...module,
64
+ };
65
+
66
+ if (isWatch) {
67
+ // 监听模块配置文件
68
+ watch(`${resolve(module.path)}/**/module.config.json`, { events: ['change'] }, () => {
69
+ buildOutputAppJson(tmsConfig, newModules, isWatch);
70
+ });
71
+ }
72
+
73
+ const excludes = module.exclude.map(key => `!${resolve(key)}`);
74
+ const modulePath = adaptPath(module.path);
75
+ const glob = {
76
+ js: [`${modulePath}/**/*.{js,ts,wxs}`, ...excludes],
77
+ json: [`${modulePath}/**/*.json`, ...excludes],
78
+ wxss: [`${modulePath}/**/*.{less,wxss}`, ...excludes],
79
+ wxml: [`${modulePath}/**/*.wxml`, ...excludes],
80
+ image: [`${modulePath}/**/*.{png,jpg,jpeg,gif,svg}`, ...excludes],
81
+ };
82
+
83
+ compile(tmsConfig, {
84
+ glob: {
85
+ ...glob,
86
+ other: [`${modulePath}/**/*`, ...excludeGlob(glob)],
87
+ },
88
+ destPath: resolve(tmsConfig.outputDir, module.root),
89
+ module: { from: module.path, to: module.root },
90
+ srcOption: { allowEmpty: true },
91
+ isWatch,
92
+ });
93
+ }
94
+
95
+ // 静态资源目录-拷贝
96
+ if (tmsConfig?.static && tmsConfig?.static.length > 0) {
97
+ for (const item of tmsConfig.static) {
98
+ item.from = adaptPath(item.from);
99
+ item.to = adaptPath(item.to);
100
+
101
+ let glob = {};
102
+ const ext = path.extname(item.from).slice(1);
103
+ if (ext) {
104
+ glob[ext] = [item.from];
105
+ } else {
106
+ glob = {
107
+ js: [`${item.from}/**/*.{js,ts,wxs}`],
108
+ json: [`${item.from}/**/*.json`],
109
+ wxss: [`${item.from}/**/*.{less,wxss}`],
110
+ wxml: [`${item.from}/**/*.wxml`],
111
+ image: [`${item.from}/**/*.{png,jpg,jpeg,gif,svg}`],
112
+ };
113
+ glob.other = [`${item.from}/**/*`, ...excludeGlob(glob)];
114
+ }
115
+
116
+ const from = fs.lstatSync(item.from).isFile() ? path.dirname(item.from) : item.from;
117
+ compile(tmsConfig, {
118
+ glob,
119
+ destPath: item.to,
120
+ module: {
121
+ from,
122
+ to: item.to,
123
+ },
124
+ srcOption: { allowEmpty: true },
125
+ isWatch,
126
+ });
127
+ }
128
+ }
129
+ };