GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — develop (#79)
by Vincent
03:31
created

browserSync.js ➔ synchronize   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
c 0
b 0
f 0
nc 2
nop 2
dl 0
loc 9
rs 9.6666
1
'use strict';
2
3
const webpack = require('webpack');
4
const webpackDevMiddleware = require('webpack-dev-middleware');
5
const webpackHotMiddleware = require('webpack-hot-middleware');
6
const htmlInjector = require('bs-html-injector');
7
const webpackConfig = require('../../config/webpack.config');
8
const bundler = webpack(webpackConfig);
9
10
module.exports = function (gulp, paths, plugins, options) {
11
    return function () {
12
// setup html injector, only compare differences within outer most div (#page)
13
// otherwise, it will replace the webpack HMR scripts
14
        plugins.browserSync.use(htmlInjector, {restrictions: ['#content']});
15
16
        return plugins.browserSync.init({
17
            files: [{
18
                // js managed by webpack
19
                // optionally exclude other managed assets: images, fonts, etc
20
                match: [paths.SRC_PATH + '**/*.!(js)'],
21
22
                // manually sync everything else
23
                fn: synchronize,
24
            }],
25
            //browsersync with a php server
26
            proxy: {
27
                target: options.url,
28
                middleware: [
29
30
                    // converts browsersync into a webpack-dev-server
31
                    webpackDevMiddleware(bundler, {
32
                        publicPath: webpackConfig.output.publicPath,
33
                        noInfo: true,
34
                        hot: true,
35
                        watchOptions: {aggregateTimeout: 10},
36
                        stats: {colors: true}
37
                    }),
38
39
                    // hot update js && css
40
                    webpackHotMiddleware(bundler),
41
                ],
42
            },
43
            notify: options.notifications
44
        });
45
46
    };
47
};
48
49
function synchronize(event, file) {
50
    // copy/remove file
51
    // if you keep assets in your src/sass folder, that might need flattened, depending on your build
52
53
    // activate html injector
54
    if (file.endsWith('php')) {
55
        htmlInjector();
56
    }
57
}