mirror of
https://github.com/bendtherules/tbl.git
synced 2026-08-18 13:51:55 +00:00
39 lines
835 B
JavaScript
39 lines
835 B
JavaScript
const path = require('path');
|
|
const webpack = require('webpack');
|
|
const supportObjectRestSpread = require('@babel/plugin-proposal-object-rest-spread');
|
|
|
|
module.exports = {
|
|
entry: {
|
|
tbl: './index.js',
|
|
'tbl.min': './index.js',
|
|
},
|
|
devtool: 'source-map',
|
|
output: {
|
|
path: path.resolve(__dirname, 'dist'),
|
|
filename: '[name].js',
|
|
libraryTarget: 'umd',
|
|
library: 'tbl',
|
|
},
|
|
plugins: [
|
|
new webpack.optimize.UglifyJsPlugin({
|
|
include: /\.min\.js$/,
|
|
minimize: true,
|
|
}),
|
|
],
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.js$/,
|
|
exclude: /(node_modules|bower_components)/,
|
|
use: {
|
|
loader: 'babel-loader',
|
|
options: {
|
|
presets: ['@babel/preset-env'],
|
|
plugins: [supportObjectRestSpread],
|
|
},
|
|
},
|
|
},
|
|
],
|
|
},
|
|
};
|