1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- const path = require('path');
- const webpack = require('webpack');
- const babelOptions = {
- presets: [
- ['@babel/preset-env', {
- corejs: 3,
- useBuiltIns: 'entry',
- targets: {
- firefox: 60,
- chrome: 65,
- opera: 52,
- safari: 11,
- },
- }],
- ],
- plugins: [
- ['@babel/plugin-transform-runtime', {
- regenerator: true,
- }],
- ['@babel/plugin-syntax-dynamic-import'],
- ],
- };
- module.exports = {
- entry: {
- app: './src/bootstrap.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', '.wasm'],
- },
- output: {
- path: path.resolve(__dirname, 'dist', 'generated'),
- filename: '[name].bundle.js',
- chunkFilename: '[name].[chunkhash].bundle.js',
- },
- };
|