import process from 'process'; import args from 'yargs'; /** * Configuration for the build process * * Distinction of development and production builds is made by user-provided node environment variable * By default, the development target will be built * * development: `gulp ...` * production: `NODE_ENV=production gulp ...` * * Additionally, if the web app has access to an API, the distinction between 'online' and 'offline' modes is made by user-provided command line argument * If no argument is given, the 'online' version will be built * * development / offline: `gulp --api-mode=offline` */ export default { currentTarget: process.env.NODE_ENV || 'development', currentMode: args.argv.apiMode || 'online', targets: { development: { delimiter: '', infix: '' }, production: { delimiter: '.', infix: 'min' } }, modes: { offline: { delimiter: '-', infix: 'offline' }, online: { delimiter: '', infix: '' } }, // .eslintcr.yml is not being read? eslint: { development: { rules: { 'no-console': 0, 'no-warning-comments': 0 }, plugins: [ 'react' ] }, production: { rules: { 'no-console': 1, 'no-warning-comments': [ 1, { terms: [ 'todo', 'fixme' ], location: 'start' } ] }, plugins: [ 'react' ] } }, // htmlhint configuration htmlhintrc: '.htmlhintrc', // gulp-sass configuration sass: { development: { outputStyle: 'nested' }, production: { outputStyle: 'nested', sourceMap: false } }, fileNames: { css: 'main', html: 'index', js: 'main', jsx: 'main' }, paths: { src: 'src', dest: 'public', assets: 'assets', css: 'css', fonts: 'fonts', html: 'html', js: 'js', images: 'img', sass: 'scss', sprites: 'sprites' }, // browsersync configuration server: { baseDir: './public/', index: 'index.html' }, logLevel: 'silent' };