-
Notifications
You must be signed in to change notification settings - Fork 107
/
config.js
64 lines (59 loc) · 1.33 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const minimist = require('minimist')
const envSettings = {
string: 'env',
default: {
env: process.env.NODE_ENV || 'development'
}
}
const options = minimist(process.argv.slice(2), envSettings)
const production = options.env === 'production'
const config = {
dirs: {
src: './src',
dest: './static'
},
envProduction: production
}
const tasks = {
scss: {
src: `${config.dirs.src}/scss/style.scss`,
dest: `${config.dirs.dest}/css`,
settings: {
autoprefixer: {
cascade: false,
grid: true
},
cssnano: { autoprefixer: false }
}
},
webpack: {
src: `${config.dirs.src}/js/app.js`,
dest: `${config.dirs.dest}/js`,
filename: 'bundle.js'
},
watch: {
css: [`${config.dirs.src}/scss/**/*.scss`],
image: [`${config.dirs.src}/img/**/*`],
webpack: [`${config.dirs.src}/js/**/*.js`]
},
images: {
src: `${config.dirs.src}/images/**/*`,
dest: `${config.dirs.dest}/images`
},
fonts: {
src: `${config.dirs.src}/fonts/**/*`,
dest: `${config.dirs.dest}/fonts`
},
svg: {
src: `${config.dirs.src}/svg/*.svg`,
dest: './svgpack'
},
svgRename: {
src: './svgpack/svgpack-sprite.svg',
dest: './layouts/partials',
filename: 'svgpack-sprite.html'
},
clean: [config.dirs.dest]
}
config.tasks = tasks
module.exports = config