Fakultas Ilmu Komputer UI

Skip to content
Snippets Groups Projects
Select Git revision
  • 1506688802-173
  • master default protected
  • spike/short-live-branch-analysis
  • 1606917720-204
  • 1606862791-246
  • 1606885864-239
  • 1606875806-244
  • 1906438014-240
  • 1606833936-243
  • 1606879773-218
  • 1606886974-179-3
  • 1606823475-175
  • 1606837991-#224
  • 1506757352-241
  • 1606890933-183
  • 1606917531-210
  • 1606837915-228
  • 1606891500-233
  • 1606889591-238
  • 1606833463-217
  • 1906438115-231
21 results

webpack.config.js

Blame
  • Forked from Fasilkom UI Open Source Software / Kape
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    webpack.config.js 2.06 KiB
    const path = require('path');
    const webpack = require('webpack');
    const BundleTracker = require('webpack-bundle-tracker');
    
    module.exports = {
      context: __dirname,
    
      entry: './assets/js/index', // entry point of our app. assets/js/index.js should require other js modules and dependencies it needs
    
      output: {
        path: path.resolve('./assets/bundles/'),
        filename: '[name]-[hash].js',
      },
    
      plugins: [
        new webpack.HotModuleReplacementPlugin(),
        new BundleTracker({ filename: './webpack-stats.json' }),
      ],
    
      module: {
        rules: [
          {
            test: /\.jsx?$/,
            exclude: /node_modules/,
            loader: 'babel-loader', // to transform JSX into JS
            options: {
              presets: ['@babel/react', '@babel/env'],
              plugins: [
                '@babel/plugin-proposal-class-properties',
                ['@babel/plugin-proposal-decorators', { legacy: true }],
                '@babel/plugin-proposal-do-expressions',
                '@babel/plugin-proposal-export-default-from',
                '@babel/plugin-proposal-export-namespace-from',
                '@babel/plugin-proposal-function-sent',
                '@babel/plugin-proposal-json-strings',
                '@babel/plugin-proposal-logical-assignment-operators',
                '@babel/plugin-proposal-nullish-coalescing-operator',
                '@babel/plugin-proposal-numeric-separator',
                '@babel/plugin-proposal-optional-chaining',
                ['@babel/plugin-proposal-pipeline-operator', { proposal: 'minimal' }],
                '@babel/plugin-proposal-throw-expressions',
                '@babel/plugin-syntax-dynamic-import',
                '@babel/plugin-syntax-import-meta',
              ],
            },
          },
          {
            test: /\.jsx?$/,
            include: path.resolve('assets/js/'),
            exclude: [path.resolve('node_modules/'), path.resolve('assets/js/__test__/')],
            loader: 'istanbul-instrumenter-loader',
            options: {
              esModules: true,
            },
            enforce: 'post',
          },
        ],
      },
    
      resolve: {
        modules: ['node_modules', 'bower_components'],
        extensions: ['*', '.js', '.jsx'],
      },
    };