const path = require('path'); function resolve(dir) { return path.join(__dirname, '..', dir) } module.exports = { context: resolve('src'), entry: './index.ts', plugins: [], externals: ['lodash', 'd3'], module: { rules: [ { test: /\.ts$/, use: 'ts-loader', exclude: /node_modules/ }, { test: /\.css$/, use: [ { loader: 'style-loader', options: { injectType: 'lazyStyleTag' } }, 'css-loader', ], exclude: /node_modules/ } ], }, resolve: { extensions: ['.ts', '.js'], }, output: { filename: 'index.js', path: resolve('lib'), libraryTarget: 'umd', umdNamedDefine: true } };