const path = require('path'); const CopyPlugin = require("copy-webpack-plugin"); function resolve(dir) { return path.join(__dirname, '..', dir) } module.exports = { context: resolve('src'), entry: './index.ts', plugins: [ new CopyPlugin({ patterns: [ { from: "../react", to: "react" }, ], }) ], module: { rules: [ { test: /\.ts$/, use: 'ts-loader', exclude: /node_modules/ }, { test: /\.css$/, use: ['style-loader', 'css-loader'], exclude: /node_modules/ } ], }, resolve: { extensions: ['.ts', '.js'], }, output: { filename: 'index.js', path: resolve('dist'), libraryTarget: 'umd', umdNamedDefine: true } };