Skip to content

Commit f3185a3

Browse files
committed
chore: update build config
1 parent 6186c7e commit f3185a3

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

build/config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
devComponent: 'select',
2+
devComponent: 'input',
33
};

build/dev.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,16 @@ const renderTemplate = name => {
128128
const demo = fs.readFileSync(path.join(__dirname, demoPath)).toString();
129129

130130
const componentsInDemo = demo.match(/a-(\w+(-\w+)*)/g) || [];
131-
componentsInDemo.forEach(name => {
132-
const componentName = name.replace(/-(\w)/g, ($, $1) => $1.toUpperCase()).replace(/^a/, '');
131+
componentsInDemo.forEach(n => {
132+
const componentName = n.replace(/-(\w)/g, ($, $1) => $1.toUpperCase()).replace(/^a/, '');
133133

134134
if (componentsInPrototype.includes(componentName)) {
135135
return;
136136
}
137137

138-
const componentPath = path.join(__dirname, `../components/${name.replace(/^a-/, '')}`);
138+
const componentPath = path.join(__dirname, `../components/${n.replace(/^a-/, '')}`);
139139
if (fs.existsSync(componentPath)) {
140-
components[componentName] = name.replace(/^a-/, '');
140+
components[componentName] = n.replace(/^a-/, '');
141141
}
142142
});
143143
});
@@ -185,6 +185,11 @@ chokidar.watch(configPath, { ignoreInitial: true }).on('change', async () => {
185185
renderTemplate(devComponent);
186186
});
187187

188+
testWatcher = chokidar.watch(path.join(__dirname, `../components/test`));
189+
testWatcher.on('change', () => {
190+
renderTemplate(devComponent);
191+
});
192+
188193
renderTemplate(devComponent);
189194

190195
const compiler = webpack(devWebpack);

0 commit comments

Comments
 (0)