UNPKG

units-converter-ts

Version:
42 lines (39 loc) 766 B
const path = require('path'); const commonConfig = { mode: 'production', entry: './src/index.ts', module: { rules: [ { test: /\.tsx?$/, use: 'ts-loader', exclude: /node_modules/, }, ], }, resolve: { extensions: ['.tsx', '.ts', '.js'], }, }; module.exports = [ { ...commonConfig, target: 'node', output: { filename: 'index.js', path: path.resolve(__dirname, 'dist', 'cjs'), libraryTarget: 'commonjs', clean: true, }, }, { ...commonConfig, target: 'web', output: { filename: 'index.js', path: path.resolve(__dirname, 'dist', 'esm'), libraryTarget: 'umd', clean: true, }, }, ];