units-converter-ts
Version:
A simple utility library for converting units
42 lines (39 loc) • 766 B
JavaScript
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,
},
},
];