UNPKG

leoutil

Version:
40 lines (39 loc) 859 B
const path = require('path') // const webpack = require('webpack') const UglifyJsPlugin = require('uglifyjs-webpack-plugin') module.exports = { mode: 'development', // production entry: './src/index.js', output: { path: path.resolve(__dirname, 'dist'), filename: 'leoutil.min.js', // library: { // root: 'leoutil', // amd: 'leoutil', // commonjs: 'leoutil' // }, library: 'leoutil', libraryTarget: 'umd' }, module: { rules: [ { test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/ } ] }, devtool: 'source-map', // 部分环境不支持eval-source-map,如小程序 plugins: [ new UglifyJsPlugin({ uglifyOptions: { compress: { warnings: false } }, sourceMap: true, parallel: true }) ] }