EightMedia / styleguide.js

Generate a styleguide from your CSS, by adding YAML data
193 stars 8 forks source link

Styleguide generated twice #19

Open powerbuoy opened 7 years ago

powerbuoy commented 7 years ago

I'm not sure it's something I've done wrong, but I've noticed this problem on two separate projects using completely different build systems.

One written by me (simple gulpfile.js) and the other inside an Aurelia CLI project.

What happens is that if I don't run the build from scratch every time but instead regenerate the styleguide on watch, every component in the styleguide will be rendered twice.

If I make changes to the component you'll see the old component and the new component after eachother.

Again, it might be something I'm doing wrong but I'm not sure what?

Here's my task:

return gulp.src('sass/app.scss')
        .pipe(sassGlob())
        .pipe(sass())
        .pipe(autoprefixer({
            browsers: ['last 1 version', 'IE 9', '> 2%']
        }))
        .pipe(styleguidejs({
            templateCss: __dirname + '/styleguide/style.css',
            templateJs: __dirname + '/styleguide/script.js',
            template: __dirname + '/styleguide/template.jade',
            outputFile: 'styleguide.html'
        }));
powerbuoy commented 7 years ago

Just to add, every time the styleguide runs, every component is added again. So after watching for a while I'll have like 5 different "Button" sections (for example).