1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- const path = require('path');
- const webpack = require('webpack');
- // Target a version without class support due to this issue:
- // https://stackoverflow.com/q/43307607
- // This does not mean that we support Firefox <60ESR!
- // We will increase the target again once FF52 has died out.
- const minFirefoxTarget = 44;
- const babelOptions = {
- presets: [
- ['@babel/preset-env', {
- corejs: 3,
- useBuiltIns: 'entry',
- targets: {
- firefox: minFirefoxTarget,
- chrome: 65,
- opera: 52,
- safari: 11,
- },
- }],
- ],
- plugins: [
- ['@babel/plugin-transform-runtime', {
- regenerator: true,
- }],
- ],
- };
- module.exports = {
- entry: {
- app: './src/app.ts',
- },
- module: {
- rules: [
- {
- test: /\.ts$/,
- exclude: /node_modules/,
- use: [
- {loader: 'babel-loader', options: babelOptions},
- {loader: 'ts-loader'},
- ],
- },
- {
- test: /\.js$/,
- exclude: /node_modules/,
- use: [
- {loader: 'babel-loader', options: babelOptions},
- ],
- },
- ],
- },
- resolve: {
- extensions: ['.js', '.ts'],
- },
- output: {
- path: path.resolve(__dirname, 'dist'),
- filename: '[name].bundle.js',
- },
- };
|