chore: update build config
parent
6186c7e83d
commit
f3185a3cf9
|
@ -1,3 +1,3 @@
|
|||
module.exports = {
|
||||
devComponent: 'select',
|
||||
devComponent: 'input',
|
||||
};
|
||||
|
|
13
build/dev.js
13
build/dev.js
|
@ -128,16 +128,16 @@ const renderTemplate = name => {
|
|||
const demo = fs.readFileSync(path.join(__dirname, demoPath)).toString();
|
||||
|
||||
const componentsInDemo = demo.match(/a-(\w+(-\w+)*)/g) || [];
|
||||
componentsInDemo.forEach(name => {
|
||||
const componentName = name.replace(/-(\w)/g, ($, $1) => $1.toUpperCase()).replace(/^a/, '');
|
||||
componentsInDemo.forEach(n => {
|
||||
const componentName = n.replace(/-(\w)/g, ($, $1) => $1.toUpperCase()).replace(/^a/, '');
|
||||
|
||||
if (componentsInPrototype.includes(componentName)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const componentPath = path.join(__dirname, `../components/${name.replace(/^a-/, '')}`);
|
||||
const componentPath = path.join(__dirname, `../components/${n.replace(/^a-/, '')}`);
|
||||
if (fs.existsSync(componentPath)) {
|
||||
components[componentName] = name.replace(/^a-/, '');
|
||||
components[componentName] = n.replace(/^a-/, '');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -185,6 +185,11 @@ chokidar.watch(configPath, { ignoreInitial: true }).on('change', async () => {
|
|||
renderTemplate(devComponent);
|
||||
});
|
||||
|
||||
testWatcher = chokidar.watch(path.join(__dirname, `../components/test`));
|
||||
testWatcher.on('change', () => {
|
||||
renderTemplate(devComponent);
|
||||
});
|
||||
|
||||
renderTemplate(devComponent);
|
||||
|
||||
const compiler = webpack(devWebpack);
|
||||
|
|
Loading…
Reference in New Issue