{"size": 3167, "ext": "js", "max_stars_repo_path": "webpack.config.js", "max_stars_repo_name": "scarwu/MHRCalculator", "max_stars_repo_stars_event_min_datetime": "2021-06-22T03:18:28.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-06T15:43:26.000Z", "max_issues_repo_path": "webpack.config.js", "max_issues_repo_name": "scarwu/MHRCalculator", "max_issues_repo_issues_event_min_datetime": "2021-07-14T16:25:23.000Z", "max_issues_repo_issues_event_max_datetime": "2021-07-14T16:25:23.000Z", "max_forks_repo_path": "webpack.config.js", "max_forks_repo_name": "scarwu/MHRCalculator", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 34.8021978022, "max_line_length": 103, "alphanum_fraction": 0.3864856331}
/**
 * Webpack Config
 *
 * @package     MHW Calculator
 * @author      Scar Wu
 * @copyright   Copyright (c) Scar Wu (http://scar.tw)
 * @link        https://github.com/scarwu/MHRCalculator
 */

const path = require('path')
const marked = require('marked')

module.exports = {
    mode: 'development',
    devtool: 'source-map',
    entry: {
        main: './src/assets/scripts/main.jsx',
        worker: './src/assets/scripts/worker.js'
    },
    output: {
        filename: '[name].min.js'
    },
    resolve: {
        modules: [
            path.resolve('./src/assets/scripts'),
            'node_modules'
        ],
        extensions: [
            '.js',
            '.jsx'
        ]
    },
    module: {
        rules: [
            {
                test: /.(js|jsx)$/,
                exclude: /node_modules/,
                use: {
                    loader: 'babel-loader',
                    options: {
                        cacheDirectory: true,
                        plugins: [
                            // Stage 0
                            '@babel/plugin-proposal-function-bind',

                            // Stage 1
                            '@babel/plugin-proposal-export-default-from',
                            '@babel/plugin-proposal-logical-assignment-operators',
                            ['@babel/plugin-proposal-optional-chaining', { 'loose': false }],
                            ['@babel/plugin-proposal-pipeline-operator', { 'proposal': 'minimal' }],
                            ['@babel/plugin-proposal-nullish-coalescing-operator', { 'loose': false }],
                            '@babel/plugin-proposal-do-expressions',

                            // Stage 2
                            ['@babel/plugin-proposal-decorators', { 'legacy': true }],
                            '@babel/plugin-proposal-function-sent',
                            '@babel/plugin-proposal-export-namespace-from',
                            '@babel/plugin-proposal-numeric-separator',
                            '@babel/plugin-proposal-throw-expressions',

                            // Stage 3
                            '@babel/plugin-syntax-dynamic-import',
                            '@babel/plugin-syntax-import-meta',
                            ['@babel/plugin-proposal-class-properties', { 'loose': false }],
                            '@babel/plugin-proposal-json-strings'
                        ],
                        presets: [
                            ['@babel/preset-env', { useBuiltIns: 'usage', corejs: 3 }],
                            '@babel/preset-react'
                        ]
                    }
                }
            },
            {
                test: /\.md$/,
                use: [
                    {
                        loader: 'html-loader'
                    },
                    {
                        loader: 'markdown-loader',
                        options: {
                            pedantic: true,
                            renderer: new marked.Renderer()
                        }
                    }
                ]
            }
        ]
    }
}