-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject.config.js
73 lines (59 loc) · 1.92 KB
/
project.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
65
66
67
68
69
70
71
72
73
const path = require('path');
const argv = require('yargs').argv;
const root = require('app-root-path');
const pkg = require('./package.json');
const isVerbose = argv.verbose;
let isDevelopment = process.env.NODE_ENV !== "production" && argv.env !== "production";
const port = process.env.PORT|| argv.port || 3000;
let distString = isDevelopment ? 'build' : 'dist';
const dist = root.resolve(distString);
let paths = {
name: pkg.name,
src: root.resolve('src'),
dist: dist,
publicPath: '/',
root: root.toString(),
vendor: root.resolve('src/vendor'),
fonts: root.resolve('src/fonts'),
components: root.resolve('src/components'),
isVerbose: isVerbose,
isDevelopment: isDevelopment,
port: port,
copy: [root.resolve('src/favicon.ico'),root.resolve('src/apple-touch-icon.png')],
html: {
src: [root.resolve('src/*.ejs'), root.resolve('src/pages/**/*.ejs')],
dist: dist,
watch: [root.resolve('src/**/*.ejs')]
},
css: {
dir: root.resolve('src/css'),
src: [root.resolve('src/css/styles.css')],
concatGulp: 'gulp.styles.css',//final name of css file builed by gulp
concatWebpack: 'webpack.styles.css',//final name of css file builed by webpack
concatProd: 'styles.css',
dist: dist,
watch: [root.resolve('src/**/*.css')]
},
js: {
src: [root.resolve('src/app.jsx')],
concat: 'bundle.js',//final name of builded js file
dist: dist
},
img: {
dir: root.resolve('src/img'),
src: root.resolve('src/img/**/*.{jpg,jpeg,png,svg,gif,webp}'),
dist: root.resolve(distString+'/img'),
watch: root.resolve('src/img/**/*.{jpg,jpeg,png,svg,gif,webp}')
},
svgSprites: {
src: 'src/img/sprites/svg/**/*.svg',
concat: 'icons.svg',
dist: root.resolve(distString+'/img'),
},
svgColoredSprites: {
src: 'src/img/sprites/svgColored/**/*.svg',
concat: 'iconsColored.svg',
dist: root.resolve(distString+'/img'),
}
}
module.exports = paths;