<commit_before>'use strict';

const gulp = require('gulp');
const babel = require('gulp-babel');
const sass = require('gulp-sass');
const webpack = require('webpack-stream');
const path = require('path');

const babelConfig = {
    presets: ['react', 'es2015'],
    plugins: [
        [
            'css-modules-transform', {
                preprocessCss: 'preprocessor.js',
                generateScopedName: '[name]__[local]___[hash:base64:5]',
                extensions: ['.css', '.scss'],
                extractCss: './dist/styles/production.css'
            }
        ]
    ]
};

module.exports = {

    defaultTaskName: 'default',

    tasks: {

        default: ['compileTemplate', 'compileStyles', 'moveImages', 'bundleAdmin', 'bundleClient', 'watchTemplates', 'watchStyles', 'watchImages'],

        watchTemplates: () => {
            return gulp.watch(
                path.join('frontend', 'js', '**', '*'),
                ['compileTemplate', 'bundleAdmin', 'bundleClient']
            );
        },

        watchStyles: () => {
            return gulp.watch(
                path.join('frontend', 'styles', '**', '*'),
                ['compileStyles']
            );
        },

        watchImages: () => {
            return gulp.watch(
                path.join('frontend', 'images', '**', '*'),
                ['moveImages']
            );
        },

        compileTemplate: () => {
            return gulp.src('./frontend/js/**/*.js')
                .pipe(babel(babelConfig))
                .pipe(gulp.dest('dist'));
        },

        compileStyles: () => {
            return gulp.src('./frontend/styles/**/*.scss')
                .pipe(sass({ includePaths: ['node_modules'] })
                    .on('error', sass.logError))
                .pipe(gulp.dest('dist/styles'));
        },

        moveImages: () => {
            return gulp.src('./frontend/images/**/*.*')
                .pipe(gulp.dest('dist/images'));
        },

        bundleAdmin: () => {
            return gulp.src('frontend/js/components/admin-bundle.js')<commit_msg>node_modules is in a different location when using docker.  Add '../node_modules' as a place for sass to look for modules.<commit_after>'use strict';

const gulp = require('gulp');
const babel = require('gulp-babel');
const sass = require('gulp-sass');
const webpack = require('webpack-stream');
const path = require('path');

const babelConfig = {
    presets: ['react', 'es2015'],
    plugins: [
        [
            'css-modules-transform', {
                preprocessCss: 'preprocessor.js',
                generateScopedName: '[name]__[local]___[hash:base64:5]',
                extensions: ['.css', '.scss'],
                extractCss: './dist/styles/production.css'
            }
        ]
    ]
};

module.exports = {

    defaultTaskName: 'default',

    tasks: {

        default: ['compileTemplate', 'compileStyles', 'moveImages', 'bundleAdmin', 'bundleClient', 'watchTemplates', 'watchStyles', 'watchImages'],

        watchTemplates: () => {
            return gulp.watch(
                path.join('frontend', 'js', '**', '*'),
                ['compileTemplate', 'bundleAdmin', 'bundleClient']
            );
        },

        watchStyles: () => {
            return gulp.watch(
                path.join('frontend', 'styles', '**', '*'),
                ['compileStyles']
            );
        },

        watchImages: () => {
            return gulp.watch(
                path.join('frontend', 'images', '**', '*'),
                ['moveImages']
            );
        },

        compileTemplate: () => {
            return gulp.src('./frontend/js/**/*.js')
                .pipe(babel(babelConfig))
                .pipe(gulp.dest('dist'));
        },

        compileStyles: () => {
            return gulp.src('./frontend/styles/**/*.scss')
                .pipe(sass({
                    includePaths: [
                        'node_modules',
                        '../node_modules'
                    ]}))
                    .on('error', sass.logError)
                .pipe(gulp.dest('dist/styles'));
        },

        moveImages: () => {
            return gulp.src('./frontend/images/**/*.*')
                .pipe(gulp.dest('dist/images'));
        },

        bundleAdmin: () => {
            return gulp.src('frontend/js/components/admin-bundle.js')
{'fraction_non_alphanumeric': 0.17684740334019675, 'fraction_numerical': 0.003202928391672386, 'mean_word_length': 1.6545233758348512, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6292418', 'n_tokens_mistral': 1269, 'n_tokens_neox': 1202, 'n_words': 193}