run webpack in watch mode during dev

This commit is contained in:
Rich Harris
2017-12-16 16:50:46 -05:00
parent 71ed3864b7
commit 5995b7ae6a
6 changed files with 54 additions and 31 deletions

View File

@@ -8,7 +8,9 @@ module.exports = function create_matchers(files) {
const parts = file.replace(/\.(html|js|mjs)$/, '').split(path.sep);
if (parts[parts.length - 1] === 'index') parts.pop();
const id = parts.join('_').replace(/[[\]]/g, '$') || '_';
const id = (
parts.join('_').replace(/[[\]]/g, '$').replace(/^\d/, '_$&').replace(/[^a-zA-Z0-9_$]/g, '_')
) || '_';
const dynamic = parts
.filter(part => part[0] === '[')