@htyf-mp/cli 0.2.0-alpha.2 → 0.2.0-alpha.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/README.md +1 -1
- package/package.json +20 -6
- package/src/HtyfImportsPlugin.mjs +190 -0
- package/src/build.mjs +146 -0
- package/src/clean.mjs +83 -0
- package/src/command-executor.mjs +107 -0
- package/src/config.mjs +55 -0
- package/src/constants.mjs +55 -0
- package/src/debug.mjs +111 -0
- package/src/file-system.mjs +96 -0
- package/src/index.mjs +14 -1099
- package/src/logger.mjs +72 -0
- package/src/project-initializer.mjs +207 -0
- package/src/shared-output.json +1 -2
- package/src/template-processor.mjs +137 -0
- package/src/utils-functions.mjs +76 -0
- package/src/utils.mjs +4 -63
- package/src/validators.mjs +82 -0
- package/src/webpack.config.mjs +16 -4
package/src/webpack.config.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import TerserPlugin from 'terser-webpack-plugin';
|
|
|
7
7
|
import * as Repack from '@callstack/repack';
|
|
8
8
|
import { ExpoModulesPlugin } from '@callstack/repack-plugin-expo-modules';
|
|
9
9
|
import { ReanimatedPlugin } from '@callstack/repack-plugin-reanimated';
|
|
10
|
-
import { HtyfModulesPlugin } from './
|
|
10
|
+
import { HtyfModulesPlugin } from './HtyfImportsPlugin.mjs';
|
|
11
11
|
import { getProjectRoot } from './utils.mjs';
|
|
12
12
|
|
|
13
13
|
// 获取当前文件和目录路径
|
|
@@ -60,7 +60,17 @@ export default (env = {}) => {
|
|
|
60
60
|
if (appExposesOptions) {
|
|
61
61
|
mpOptions = JSON.parse(decodeURI(appExposesOptions));
|
|
62
62
|
}
|
|
63
|
+
console.log('\n');
|
|
64
|
+
console.log('=====mpOptions=====');
|
|
65
|
+
console.log('\n');
|
|
66
|
+
console.log('context:', projectRoot);
|
|
67
|
+
console.log('\n');
|
|
68
|
+
console.log('entry:', entry);
|
|
69
|
+
console.log('\n');
|
|
63
70
|
console.log(JSON.stringify(mpOptions, null, 2));
|
|
71
|
+
console.log('\n');
|
|
72
|
+
console.log('=====mpOptions=====');
|
|
73
|
+
console.log('\n');
|
|
64
74
|
// 基础Webpack配置
|
|
65
75
|
const mpConfig = {
|
|
66
76
|
context,
|
|
@@ -71,6 +81,8 @@ export default (env = {}) => {
|
|
|
71
81
|
output: {
|
|
72
82
|
// 默认输出路径,host模式下会被覆盖
|
|
73
83
|
path: mpOptions.outputPath,
|
|
84
|
+
publicPath: mpOptions.outputPath,
|
|
85
|
+
// uniqueName: `htyf_mp_for_${mpOptions.name}`,
|
|
74
86
|
},
|
|
75
87
|
module: {
|
|
76
88
|
rules: [
|
|
@@ -79,9 +91,9 @@ export default (env = {}) => {
|
|
|
79
91
|
test: /\.[cm]?[jt]sx?$/,
|
|
80
92
|
use: {
|
|
81
93
|
loader: 'babel-loader',
|
|
82
|
-
options: {
|
|
83
|
-
|
|
84
|
-
}
|
|
94
|
+
// options: {
|
|
95
|
+
// configFile: path.resolve(__dirname, './babel.config.js'),
|
|
96
|
+
// }
|
|
85
97
|
},
|
|
86
98
|
type: 'javascript/auto',
|
|
87
99
|
},
|