build-config.js   A
last analyzed

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 98
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 75
mnd 0
bc 0
fnc 1
dl 0
loc 98
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A ➔ getCopyConfig 0 17 1
1
const host = 'https://flynt.test'
2
const dest = './dist'
3
4
function getCopyConfig (source) {
5
  return {
6
    from: source,
7
    to: './',
8
    noErrorOnMissing: true,
9
    globOptions: {
10
      ignore: [
11
        '**/*.js',
12
        '**/*.scss',
13
        '**/*.php',
14
        '**/*.twig',
15
        '**/screenshot.png',
16
        '**/README.md'
17
      ]
18
    }
19
  }
20
}
21
22
module.exports = {
23
  webpack: {
24
    entry: {
25
      'assets/main': './assets/main.js',
26
      'assets/admin': './assets/admin.js'
27
    },
28
    copy: {
29
      patterns: [
30
        getCopyConfig('./Components/**/*'),
31
        getCopyConfig('./assets/**/*')
32
      ]
33
    }
34
  },
35
  browserSync: {
36
    ghostMode: false,
37
    open: false,
38
    proxy: {
39
      target: host,
40
      ws: false
41
    },
42
    watchOptions: {
43
      ignoreInitial: true
44
    },
45
    injectChanges: true,
46
    reloadDebounce: 1000,
47
    ui: false,
48
    files: [
49
      '*.php',
50
      'templates/**/*',
51
      'lib/**/*',
52
      'inc/**/*',
53
      './Components/**/*.{php,twig}'
54
    ],
55
    watch: true,
56
    https: true
57
  },
58
  webpackDevMiddleware: {
59
    stats: false,
60
    writeToDisk: true
61
  },
62
  gulp: {
63
    dest: dest,
64
    rev: {
65
      src: dest + '/**/*.*',
66
      srcRevved: [dest + '/**/*.{js,css}', '!' + dest + '/style.css'],
67
      srcStatic: dest + '/**/*.{html,php,twig}',
68
      assetSrc: [
69
        dest + '/**/*',
70
        '!' + dest + '/**/*+(css|js|json|html|php|twig|pot|md|htc|swf|xap)',
71
        '!' + dest + '/style.css',
72
        '!' + dest + '/screenshot.png',
73
        '!' + dest + '/favicon.ico',
74
        '!' + dest + '/favicon.png',
75
        '!' + dest + '/apple-touch-icon-180x180.png',
76
        '!' + dest + '/apple-touch-icon.png',
77
        '!' + dest + '/**/screenshot.png'
78
      ],
79
      revvedFileExtensions: ['.js', '.css'],
80
      staticFileExtensions: ['.html', '.php', '.twig']
81
    },
82
    replaceVersion: {
83
      wordpress: {
84
        files: './style.css',
85
        from: /Version: (.*)/gi,
86
        to: 'Version: '
87
      },
88
      php: {
89
        files: '!(node_modules|dist)/**/*.php',
90
        from: '%%NEXT_VERSION%%'
91
      },
92
      js: {
93
        files: '!(node_modules|dist)/**/*.js',
94
        from: '%%NEXT_VERSION%%'
95
      }
96
    }
97
  }
98
}
99