<commit_before>/**
 * 默认webpack配置
 */
"use strict";

const path = require('path');

module.exports = function (options) {
    options || (options = {});

    const cwd = options.cwd ? options.cwd : process.cwd();

    return {
        context: cwd,

        profile: true,

        output: {
            libraryTarget: 'var',

            publicPath: '',

            path: 'dist',

            templateDir: 'html',
            jsDir: 'js',
            cssDir: 'css',
            imageDir: 'images',
            fontDir: 'fonts'
        },

        module: {
            rules: []
        },

        externals: [{
            'react': {
                root: 'React',
                var: 'React',
                commonjs2: 'react',
                commonjs: 'react',
                amd: 'react',
                umd: 'react'
            },

            'react-dom': {
                root: 'ReactDOM',
                var: 'ReactDOM',
                commonjs2: 'react-dom',
                commonjs: 'react-dom',
                amd: 'react-dom',
                umd: 'react-dom'
            },

            'jquery': {
                root: 'window.jQuery',
                var: 'window.jQuery',
                commonjs2: 'jquery',
                commonjs: 'jquery',
                amd: 'jquery',
                umd: 'jquery'
            }
        }],

        resolve: {
            // tree-shaking优化, http://imweb.io/topic/5868e1abb3ce6d8e3f9f99bb
            mainFields: ['jsnext:main','main'],
            modules: [
                path.join(__dirname, '..', 'node_modules'),
                path.join(cwd, 'node_modules')
            ],
            // 配置别名，在项目中可缩减引用路径
            alias: {
                // handlebars-loader默认所使用的runtime，每次都会重新构建
                // 此方法不用重新构建，加快整体构建速度
                'handlebars/runtime': require.resolve('handlebars/dist/handlebars.runtime')
            }
        },
        resolveLoader: {
            modules: [
                path.join(__dirname, '..', 'node_modules'),
                path.join(cwd, 'node_modules')
            ]
        },
        plugins: []
    }
};<commit_msg>refactor: edit resolve.extensions defaults value<commit_after>/**
 * 默认webpack配置
 */
"use strict";

const path = require('path');

module.exports = function (options) {
    options || (options = {});

    const cwd = options.cwd ? options.cwd : process.cwd();

    return {
        context: cwd,

        profile: true,

        output: {
            libraryTarget: 'var',

            publicPath: '',

            path: 'dist',

            templateDir: 'html',
            jsDir: 'js',
            cssDir: 'css',
            imageDir: 'images',
            fontDir: 'fonts'
        },

        module: {
            rules: []
        },

        externals: [{
            'react': {
                root: 'React',
                var: 'React',
                commonjs2: 'react',
                commonjs: 'react',
                amd: 'react',
                umd: 'react'
            },

            'react-dom': {
                root: 'ReactDOM',
                var: 'ReactDOM',
                commonjs2: 'react-dom',
                commonjs: 'react-dom',
                amd: 'react-dom',
                umd: 'react-dom'
            },

            'jquery': {
                root: 'window.jQuery',
                var: 'window.jQuery',
                commonjs2: 'jquery',
                commonjs: 'jquery',
                amd: 'jquery',
                umd: 'jquery'
            }
        }],

        resolve: {
            // tree-shaking优化, http://imweb.io/topic/5868e1abb3ce6d8e3f9f99bb
            mainFields: ['jsnext:main','main'],
            modules: [
                path.join(__dirname, '..', 'node_modules'),
                path.join(cwd, 'node_modules')
            ],
            // 配置别名，在项目中可缩减引用路径
            alias: {
                // handlebars-loader默认所使用的runtime，每次都会重新构建
                // 此方法不用重新构建，加快整体构建速度
                'handlebars/runtime': require.resolve('handlebars/dist/handlebars.runtime')
            },
            extensions: ['.js', 'jsx', '.json']
        },
        resolveLoader: {
            modules: [
                path.join(__dirname, '..', 'node_modules'),
                path.join(cwd, 'node_modules')
            ]
        },
        plugins: []
    }
};
{'fraction_non_alphanumeric': 0.13565536205316223, 'fraction_numerical': 0.0068744271310724105, 'mean_word_length': 1.13134765625, 'pattern_counts': {'":': 0, '<': 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': '3370746', 'n_tokens_mistral': 1334, 'n_tokens_neox': 1283, 'n_words': 214}