neo-cmp-cli 1.0.16 → 1.0.17
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 +1 -1
- package/src/module/index.js +2 -0
- package/src/module/previewCmp.js +6 -1
package/package.json
CHANGED
package/src/module/index.js
CHANGED
package/src/module/previewCmp.js
CHANGED
|
@@ -43,7 +43,12 @@ module.exports = (config, cmpName, defaultComponentsDir = './src/components') =>
|
|
|
43
43
|
fs.writeFileSync(`${tempCmpDir}/preview.jsx`, cmpPreviewContent);
|
|
44
44
|
|
|
45
45
|
// 将临时预览文件添加到预览配置中
|
|
46
|
-
config.dev.entry
|
|
46
|
+
if (!config.dev.entry) {
|
|
47
|
+
config.dev.entry = {};
|
|
48
|
+
}
|
|
49
|
+
// 添加预览入口文件
|
|
50
|
+
config.dev.entry.index = `${tempCmpDir}/preview.jsx`;
|
|
51
|
+
|
|
47
52
|
if (config.webpack.projectDir) {
|
|
48
53
|
config.webpack.projectDir.push(tempCmpDir);
|
|
49
54
|
} else {
|