2018-12-16 23:02:16 +02:00
|
|
|
/**
|
2023-07-20 04:32:40 -07:00
|
|
|
* Hello Elementor theme Makefile
|
2018-12-16 23:02:16 +02:00
|
|
|
*/
|
2018-12-24 18:48:42 +02:00
|
|
|
'use strict';
|
2018-12-16 23:02:16 +02:00
|
|
|
|
|
|
|
module.exports = function( grunt ) {
|
2023-03-20 17:24:09 +02:00
|
|
|
require( 'load-grunt-tasks' )( grunt );
|
2021-05-20 13:50:14 +02:00
|
|
|
|
2022-08-30 18:33:50 +03:00
|
|
|
const sass = require( 'sass' );
|
2018-12-16 23:02:16 +02:00
|
|
|
|
2018-12-24 18:48:42 +02:00
|
|
|
// Project configuration.
|
2018-12-24 13:23:39 +02:00
|
|
|
grunt.initConfig( {
|
2018-12-24 18:48:42 +02:00
|
|
|
pkg: grunt.file.readJSON( 'package.json' ),
|
2018-12-16 23:02:16 +02:00
|
|
|
|
2018-12-24 18:48:42 +02:00
|
|
|
sass: {
|
2021-03-18 17:27:57 +02:00
|
|
|
options: {
|
2021-05-20 13:50:14 +02:00
|
|
|
implementation: sass,
|
2021-03-18 17:27:57 +02:00
|
|
|
},
|
2018-12-24 18:48:42 +02:00
|
|
|
dist: {
|
2021-06-14 17:21:42 +03:00
|
|
|
files: 'production' === grunt.option( 'environment' ) ? [ {
|
2018-12-24 18:48:42 +02:00
|
|
|
expand: true,
|
|
|
|
cwd: 'assets/scss',
|
|
|
|
src: '*.scss',
|
2021-06-10 13:47:01 +03:00
|
|
|
dest: './build',
|
2021-05-20 13:50:14 +02:00
|
|
|
ext: '.css',
|
2021-06-14 17:21:42 +03:00
|
|
|
} ] : [ {
|
|
|
|
expand: true,
|
|
|
|
cwd: 'assets/scss',
|
|
|
|
src: '*.scss',
|
|
|
|
dest: './',
|
|
|
|
ext: '.css',
|
2021-05-20 13:50:14 +02:00
|
|
|
} ],
|
|
|
|
},
|
2018-12-24 18:48:42 +02:00
|
|
|
},
|
2018-12-16 23:02:16 +02:00
|
|
|
|
2018-12-24 18:48:42 +02:00
|
|
|
postcss: {
|
|
|
|
dev: {
|
|
|
|
options: {
|
|
|
|
//map: true,
|
2018-12-16 23:02:16 +02:00
|
|
|
|
2018-12-24 18:48:42 +02:00
|
|
|
processors: [
|
2023-03-15 17:03:45 +02:00
|
|
|
require( 'autoprefixer' )(),
|
2021-05-20 13:50:14 +02:00
|
|
|
],
|
2018-12-24 18:48:42 +02:00
|
|
|
},
|
|
|
|
files: [ {
|
|
|
|
src: [
|
|
|
|
'*.css',
|
2021-05-20 13:50:14 +02:00
|
|
|
'!*.min.css',
|
|
|
|
],
|
|
|
|
} ],
|
2018-12-24 18:48:42 +02:00
|
|
|
},
|
2019-05-23 13:56:51 +03:00
|
|
|
minify: {
|
2018-12-24 18:48:42 +02:00
|
|
|
options: {
|
|
|
|
processors: [
|
2023-03-15 17:03:45 +02:00
|
|
|
require( 'autoprefixer' )(),
|
2021-05-20 13:50:14 +02:00
|
|
|
require( 'cssnano' )( {
|
2019-10-11 11:14:58 +02:00
|
|
|
reduceIdents: false,
|
2019-12-23 14:43:54 +02:00
|
|
|
zindex: false,
|
2021-05-20 13:50:14 +02:00
|
|
|
} ),
|
|
|
|
],
|
2018-12-24 18:48:42 +02:00
|
|
|
},
|
|
|
|
files: [ {
|
2019-06-04 14:20:28 +03:00
|
|
|
expand: true,
|
2021-06-14 17:21:42 +03:00
|
|
|
src: 'production' === grunt.option( 'environment' ) ? [
|
2021-06-10 13:47:01 +03:00
|
|
|
'build/*.css',
|
|
|
|
'!build/*.min.css',
|
2021-06-14 17:21:42 +03:00
|
|
|
] : [
|
|
|
|
'*.css',
|
|
|
|
'!*.min.css',
|
2018-12-24 18:48:42 +02:00
|
|
|
],
|
2021-05-20 13:50:14 +02:00
|
|
|
ext: '.min.css',
|
|
|
|
} ],
|
|
|
|
},
|
2018-12-24 18:48:42 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
watch: {
|
|
|
|
styles: {
|
|
|
|
files: [
|
2021-05-20 13:50:14 +02:00
|
|
|
'assets/scss/**/*.scss',
|
2018-12-24 18:48:42 +02:00
|
|
|
],
|
2021-05-20 13:50:14 +02:00
|
|
|
tasks: [ 'styles' ],
|
|
|
|
},
|
2018-12-24 18:48:42 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
checktextdomain: {
|
|
|
|
options: {
|
2019-02-12 10:48:21 +02:00
|
|
|
text_domain: 'hello-elementor',
|
2018-12-24 18:48:42 +02:00
|
|
|
correct_domain: true,
|
|
|
|
keywords: [
|
|
|
|
// WordPress keywords
|
|
|
|
'__:1,2d',
|
|
|
|
'_e:1,2d',
|
|
|
|
'_x:1,2c,3d',
|
|
|
|
'esc_html__:1,2d',
|
|
|
|
'esc_html_e:1,2d',
|
|
|
|
'esc_html_x:1,2c,3d',
|
|
|
|
'esc_attr__:1,2d',
|
|
|
|
'esc_attr_e:1,2d',
|
|
|
|
'esc_attr_x:1,2c,3d',
|
|
|
|
'_ex:1,2c,3d',
|
|
|
|
'_n:1,2,4d',
|
|
|
|
'_nx:1,2,4c,5d',
|
|
|
|
'_n_noop:1,2,3d',
|
2021-05-20 13:50:14 +02:00
|
|
|
'_nx_noop:1,2,3c,4d',
|
|
|
|
],
|
2018-12-24 18:48:42 +02:00
|
|
|
},
|
|
|
|
files: {
|
|
|
|
src: [
|
|
|
|
'**/*.php',
|
|
|
|
'!docs/**',
|
|
|
|
'!bin/**',
|
|
|
|
'!node_modules/**',
|
|
|
|
'!build/**',
|
|
|
|
'!tests/**',
|
|
|
|
'!.github/**',
|
|
|
|
'!vendor/**',
|
2021-05-20 13:50:14 +02:00
|
|
|
'!*~',
|
2018-12-24 18:48:42 +02:00
|
|
|
],
|
2021-05-20 13:50:14 +02:00
|
|
|
expand: true,
|
2018-12-24 18:48:42 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
} );
|
2018-12-16 23:02:16 +02:00
|
|
|
|
2018-12-24 13:23:39 +02:00
|
|
|
grunt.registerTask( 'i18n', [
|
|
|
|
'checktextdomain',
|
|
|
|
] );
|
2018-12-16 23:02:16 +02:00
|
|
|
|
|
|
|
grunt.registerTask( 'styles', [
|
|
|
|
'sass',
|
2021-05-20 13:50:14 +02:00
|
|
|
'postcss',
|
2018-12-16 23:02:16 +02:00
|
|
|
] );
|
|
|
|
|
|
|
|
// Default task(s).
|
|
|
|
grunt.registerTask( 'default', [
|
2018-12-24 18:48:42 +02:00
|
|
|
'i18n',
|
|
|
|
'styles',
|
2018-12-16 23:02:16 +02:00
|
|
|
] );
|
|
|
|
};
|