<commit_before>/*global module */

var libraries = ['react', 'react-dom', 'jquery', 'lodash', 'd3', 'c3', 'react-bootstrap', 'openlayers', 'jszip', 'swfobject-amd'];
var libraries_colon = libraries.map(function (d) { return d + ":"});

module.exports = function (grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        ts: {
            default: {
                tsconfig: true
            }
        },
        babel: {
            options: {
                babelrc: ".babelrc"
            },
            dist: {
               files: [{
                   "expand": true,
                   "cwd": "outts/",
                   "src": ["**/*.jsx", "**/*.js"],
                   "dest": "lib/",
                   "ext": ".js"
               }]
           }
        },
        browserify: {
            // default options for browserify
            options: {
                browserifyOptions: {
                    plugin: [['minifyify']]
                },
                transform: ["babelify"],
                external: libraries,
                watch: true
            },
            distlibs: {
                src: ['src/'],
                dest: 'dist/libs.js',
                options: {
                    alias: libraries_colon,
                    external: null,
                    transform: null,
                    browserifyOptions: {
                        debug: false,
                    }
                },
            },
            devlibs: {
                src: ['src/'],
                dest: 'dist/libs.js',
                options: {
                    alias: libraries_colon,
                    external: null,
                    transform: null,
                    browserifyOptions: {
                        debug: true,
                    }
                }
            },
            // this generates a minified ouput of the app without the libs
            dist: {
                options: {
                    browserifyOptions: {
                        debug: false,
                        plugin: [['minifyify', {map: false}]],
                        extensions: ['.jsx']
                    }
                },
                files: [{'dist/index.min.js': 'src/index.js'}/*, {'dist/test.min.js': 'src/test.js'}*/]
            },
            // generates a non minified output without the libs but with source maps
            dev: {
                options: {
                    browserifyOptions: {
                        debug: true,
                        plugin: [],
                        extensions: ['.jsx']
                    }
                },
                files: [{'dist/index.js': 'src/index.js'}, {'dist/multipleView.js': 'src/multipleView.js'}]
            },
        },
        copy: {
            main: {expand: true, flatten: true, cwd: 'src/', src: '**/*.html', dest: 'dist/'},
            css: {expand: true, flatten: true, cwd: 'src/', src: 'css/*.css', dest: 'dist/'},
            olcss: {expand: true, flatten: true, cwd: 'node_modules/openlayers/css', src: 'ol.css', dest: 'dist/'},
            fontawesomecss: {expand: true, flatten: true, cwd: 'node_modules/font-awesome/css', src: 'font-awesome.css', dest: 'dist/css/'},
            fontawesomefont: {expand: true, flatten: true, cwd: 'node_modules/font-awesome/fonts', src: '*', dest: 'dist/fonts/'},
            fonts: {expand: true, flatten: true, cwd: 'node_modules/bootstrap', src: 'fonts/*.*', dest: 'dist/fonts/'},
            images: {expand: true, flatten: true, cwd: 'img/', src: '*', dest: 'dist/img/'},
            weavesessions: {expand: true, flatten: true, cwd: 'weave_sessions', src: "*", dest: "dist/"},
            polyfill: {expand: true, flatten: true, cwd: 'node_modules/babel-polyfill/dist', src: 'polyfill.min.js', dest: 'dist/'}
        },
        clean: {
            ts: ["outts"],
            babel: ["lib"],
            dist: ["dist/*.js", "dist/*.css", "dist/*.html"]
        },
    });

    grunt.loadNpmTasks('grunt-ts');
    grunt.loadNpmTasks('grunt-babel');
    grunt.loadNpmTasks('grunt-browserify');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-minifyify');

    grunt.registerTask('devlibs', ['browserify:devlibs']);
    grunt.registerTask('distlibs', ['browserify:distlibs']);
    grunt.registerTask('default', ['ts', 'babel', 'browserify:dev', 'copy']);
    grunt.registerTask('all', ['clean', 'ts', 'babel', 'distlibs', 'copy']);
    grunt.registerTask('distall', ['clean', 'ts', 'babel', 'browserify:dist', 'copy']);
};
<commit_msg>Revert "Add copy target for babel-polyfill"<commit_after>/*global module */

var libraries = ['react', 'react-dom', 'jquery', 'lodash', 'd3', 'c3', 'react-bootstrap', 'openlayers', 'jszip', 'swfobject-amd'];
var libraries_colon = libraries.map(function (d) { return d + ":"});

module.exports = function (grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        ts: {
            default: {
                tsconfig: true
            }
        },
        babel: {
            options: {
                babelrc: ".babelrc"
            },
            dist: {
               files: [{
                   "expand": true,
                   "cwd": "outts/",
                   "src": ["**/*.jsx", "**/*.js"],
                   "dest": "lib/",
                   "ext": ".js"
               }]
           }
        },
        browserify: {
            // default options for browserify
            options: {
                browserifyOptions: {
                    plugin: [['minifyify']]
                },
                transform: ["babelify"],
                external: libraries,
                watch: true
            },
            distlibs: {
                src: ['src/'],
                dest: 'dist/libs.js',
                options: {
                    alias: libraries_colon,
                    external: null,
                    transform: null,
                    browserifyOptions: {
                        debug: false,
                    }
                },
            },
            devlibs: {
                src: ['src/'],
                dest: 'dist/libs.js',
                options: {
                    alias: libraries_colon,
                    external: null,
                    transform: null,
                    browserifyOptions: {
                        debug: true,
                    }
                }
            },
            // this generates a minified ouput of the app without the libs
            dist: {
                options: {
                    browserifyOptions: {
                        debug: false,
                        plugin: [['minifyify', {map: false}]],
                        extensions: ['.jsx']
                    }
                },
                files: [{'dist/index.min.js': 'src/index.js'}/*, {'dist/test.min.js': 'src/test.js'}*/]
            },
            // generates a non minified output without the libs but with source maps
            dev: {
                options: {
                    browserifyOptions: {
                        debug: true,
                        plugin: [],
                        extensions: ['.jsx']
                    }
                },
                files: [{'dist/index.js': 'src/index.js'}, {'dist/multipleView.js': 'src/multipleView.js'}]
            },
        },
        copy: {
            main: {expand: true, flatten: true, cwd: 'src/', src: '**/*.html', dest: 'dist/'},
            css: {expand: true, flatten: true, cwd: 'src/', src: 'css/*.css', dest: 'dist/'},
            olcss: {expand: true, flatten: true, cwd: 'node_modules/openlayers/css', src: 'ol.css', dest: 'dist/'},
            fontawesomecss: {expand: true, flatten: true, cwd: 'node_modules/font-awesome/css', src: 'font-awesome.css', dest: 'dist/css/'},
            fontawesomefont: {expand: true, flatten: true, cwd: 'node_modules/font-awesome/fonts', src: '*', dest: 'dist/fonts/'},
            fonts: {expand: true, flatten: true, cwd: 'node_modules/bootstrap', src: 'fonts/*.*', dest: 'dist/fonts/'},
            images: {expand: true, flatten: true, cwd: 'img/', src: '*', dest: 'dist/img/'},
            weavesessions: {expand: true, flatten: true, cwd: 'weave_sessions', src: "*", dest: "dist/"}
        },
        clean: {
            ts: ["outts"],
            babel: ["lib"],
            dist: ["dist/*.js", "dist/*.css", "dist/*.html"]
        },
    });

    grunt.loadNpmTasks('grunt-ts');
    grunt.loadNpmTasks('grunt-babel');
    grunt.loadNpmTasks('grunt-browserify');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-minifyify');

    grunt.registerTask('devlibs', ['browserify:devlibs']);
    grunt.registerTask('distlibs', ['browserify:distlibs']);
    grunt.registerTask('default', ['ts', 'babel', 'browserify:dev', 'copy']);
    grunt.registerTask('all', ['clean', 'ts', 'babel', 'distlibs', 'copy']);
    grunt.registerTask('distall', ['clean', 'ts', 'babel', 'browserify:dist', 'copy']);
};

{'fraction_non_alphanumeric': 0.16213857064920895, 'fraction_numerical': 0.000436442989634479, 'mean_word_length': 1.3944618599791014, 'pattern_counts': {'":': 12, '<': 3, '<?xml version=': 0, '>': 3, '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': '168839', 'n_tokens_mistral': 2701, 'n_tokens_neox': 2541, 'n_words': 548}