123456789101112131415161718192021222324252627282930313233343536373839404142 |
- const path = require('path');
- const { CleanWebpackPlugin } = require('clean-webpack-plugin');
- const TerserPlugin = require('terser-webpack-plugin');
- module.exports = {
- entry: './src/index.js',
- output: {
- path: path.resolve(__dirname, 'dist'),
- filename: 'main.js',
- library: {
- name: 'buried-piont',
- type: 'umd',
- },
- globalObject: 'this',
- },
- mode: 'production',
- module: {
- rules: [
- {
- test: /\.css$/,
- use: [
- 'style-loader',
- 'css-loader'
- ]
- },
- {
- test: /\.js$/,
- exclude: /node_modules/,
- use: {
- loader: 'babel-loader',
- options: {
- presets: ['@babel/preset-env'],
- },
- },
- },
- ],
- },
- optimization: {
- minimizer: [new TerserPlugin()],
- },
- plugins: [new CleanWebpackPlugin()],
- };
|