mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-14 05:36:58 +03:00
Fix linting issues in Gulpfile
This commit is contained in:
parent
e08b17a234
commit
382dce2803
|
@ -29,14 +29,14 @@ function pathsConfig(appName) {
|
||||||
const vendorsRoot = 'node_modules'
|
const vendorsRoot = 'node_modules'
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{% if cookiecutter.custom_bootstrap_compilation == 'y' %}
|
{%- if cookiecutter.custom_bootstrap_compilation == 'y' %}
|
||||||
bootstrapSass: `${vendorsRoot}/bootstrap/scss`,
|
bootstrapSass: `${vendorsRoot}/bootstrap/scss`,
|
||||||
vendorsJs: [
|
vendorsJs: [
|
||||||
`${vendorsRoot}/jquery/dist/jquery.slim.js`,
|
`${vendorsRoot}/jquery/dist/jquery.slim.js`,
|
||||||
`${vendorsRoot}/popper.js/dist/umd/popper.js`,
|
`${vendorsRoot}/popper.js/dist/umd/popper.js`,
|
||||||
`${vendorsRoot}/bootstrap/dist/js/bootstrap.js`,
|
`${vendorsRoot}/bootstrap/dist/js/bootstrap.js`,
|
||||||
],
|
],
|
||||||
{% endif %}
|
{%- endif %}
|
||||||
app: this.app,
|
app: this.app,
|
||||||
templates: `${this.app}/templates`,
|
templates: `${this.app}/templates`,
|
||||||
css: `${this.app}/static/css`,
|
css: `${this.app}/static/css`,
|
||||||
|
@ -67,9 +67,9 @@ function styles() {
|
||||||
return src(`${paths.sass}/project.scss`)
|
return src(`${paths.sass}/project.scss`)
|
||||||
.pipe(sass({
|
.pipe(sass({
|
||||||
includePaths: [
|
includePaths: [
|
||||||
{% if cookiecutter.custom_bootstrap_compilation == 'y' %}
|
{%- if cookiecutter.custom_bootstrap_compilation == 'y' %}
|
||||||
paths.bootstrapSass,
|
paths.bootstrapSass,
|
||||||
{% endif %}
|
{%- endif %}
|
||||||
paths.sass
|
paths.sass
|
||||||
]
|
]
|
||||||
}).on('error', sass.logError))
|
}).on('error', sass.logError))
|
||||||
|
@ -90,7 +90,7 @@ function scripts() {
|
||||||
.pipe(dest(paths.js))
|
.pipe(dest(paths.js))
|
||||||
}
|
}
|
||||||
|
|
||||||
{% if cookiecutter.custom_bootstrap_compilation == 'y' %}
|
{%- if cookiecutter.custom_bootstrap_compilation == 'y' %}
|
||||||
// Vendor Javascript minification
|
// Vendor Javascript minification
|
||||||
function vendorScripts() {
|
function vendorScripts() {
|
||||||
return src(paths.vendorsJs)
|
return src(paths.vendorsJs)
|
||||||
|
@ -101,7 +101,7 @@ function vendorScripts() {
|
||||||
.pipe(rename({ suffix: '.min' }))
|
.pipe(rename({ suffix: '.min' }))
|
||||||
.pipe(dest(paths.js))
|
.pipe(dest(paths.js))
|
||||||
}
|
}
|
||||||
{% endif %}
|
{%- endif %}
|
||||||
|
|
||||||
// Image compression
|
// Image compression
|
||||||
function imgCompression() {
|
function imgCompression() {
|
||||||
|
@ -110,7 +110,7 @@ function imgCompression() {
|
||||||
.pipe(dest(paths.images))
|
.pipe(dest(paths.images))
|
||||||
}
|
}
|
||||||
|
|
||||||
{% if cookiecutter.use_async == 'y' -%}
|
{%- if cookiecutter.use_async == 'y' -%}
|
||||||
// Run django server
|
// Run django server
|
||||||
function asyncRunServer() {
|
function asyncRunServer() {
|
||||||
var cmd = spawn('gunicorn', [
|
var cmd = spawn('gunicorn', [
|
||||||
|
@ -143,7 +143,7 @@ function initBrowserSync() {
|
||||||
// https://www.browsersync.io/docs/options/#option-proxy
|
// https://www.browsersync.io/docs/options/#option-proxy
|
||||||
{%- if cookiecutter.use_docker == 'n' %}
|
{%- if cookiecutter.use_docker == 'n' %}
|
||||||
proxy: 'localhost:8000'
|
proxy: 'localhost:8000'
|
||||||
{% else %}
|
{%- else %}
|
||||||
proxy: {
|
proxy: {
|
||||||
target: 'django:8000',
|
target: 'django:8000',
|
||||||
proxyReq: [
|
proxyReq: [
|
||||||
|
@ -172,7 +172,7 @@ function watchPaths() {
|
||||||
const generateAssets = parallel(
|
const generateAssets = parallel(
|
||||||
styles,
|
styles,
|
||||||
scripts,
|
scripts,
|
||||||
{% if cookiecutter.custom_bootstrap_compilation == 'y' %}vendorScripts,{% endif %}
|
{%- if cookiecutter.custom_bootstrap_compilation == 'y' %}vendorScripts,{% endif %}
|
||||||
imgCompression
|
imgCompression
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user