const path = require ( 'path' ) ; const merge = require ( 'webpack-merge' ) ; const baseWebpackConfig = require ( './webpack.base.conf' ) ; const TerserPlugin = require ( 'terser-webpack-plugin' ) ; const OptimizeCssAssetsPlugin = require ( 'optimize-css-assets-webpack-plugin' ) ; module . exports = merge ( baseWebpackConfig , { devtool : 'source-map' , entry : { 'we-vue' : './src/index.ts' , } , output : { path : path . join ( __dirname , '../dist' ) , publicPath : '/dist/' , library : 'we-vue' , libraryTarget : 'umd' , libraryExport : 'default' , globalObject : 'typeof self !== \'undefined\' ? self : this' , } , externals : { vue : { root : 'Vue' , commonjs : 'vue' , commonjs2 : 'vue' , amd : 'vue' , } , } , module : { rules : [ { test : /\.js$/ , use : [ { loader : 'thread-loader' , } , 'babel-loader' , ] , exclude : /node_modules/ , } , { test : /\.tsx?$/ , use : [ { loader : 'thread-loader' , } , { loader : 'babel-loader' , } , { loader : 'ts-loader' , options : { transpileOnly : true , happyPackMode : true , experimentalWatchApi : true , } , } , ] , exclude : /node_modules/ , } , ] , } , } ) ;