123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- /* eslint-disable @typescript-eslint/no-var-requires */
- const path = require('path');
- const webpack = require('webpack'); //to access built-in plugins
- const sourceMapPlugin = new webpack.SourceMapDevToolPlugin({
- filename: 'sourcemaps/[file].map',
- fileContext: 'public',
- });
- // devtool: 'inline-source-map',
- module.exports = [
- {
- mode: 'production',
- name: 'minimized-prod',
- entry: {
- 'animation-timeline': './src/animation-timeline.ts',
- },
- module: {
- rules: [
- {
- test: /\.tsx?$/,
- loader: 'babel-loader',
- exclude: [/node_modules/, /lib/],
- },
- ],
- },
- resolve: {
- extensions: ['.tsx', '.ts'],
- },
- output: {
- filename: '[name].min.js',
- libraryTarget: 'umd',
- library: 'timelineModule',
- // eslint-disable-next-line no-undef
- path: path.resolve(__dirname, 'lib'),
- },
- },
- {
- // Development unminimized file
- mode: 'production',
- name: 'unminimized',
- entry: {
- 'animation-timeline': './src/animation-timeline.ts',
- },
- module: {
- rules: [
- {
- test: /\.tsx?$/,
- loader: 'babel-loader',
- exclude: [/node_modules/, /lib/],
- },
- ],
- },
- resolve: {
- extensions: ['.tsx', '.ts'],
- },
- optimization: {
- minimize: false,
- },
- output: {
- filename: '[name].js',
- libraryTarget: 'umd',
- library: 'timelineModule',
- // eslint-disable-next-line no-undef
- path: path.resolve(__dirname, 'lib'),
- },
- // Add source maps for the dev instance
- plugins: [sourceMapPlugin],
- },
- ];
|