striven-editor

Maintained and contributed to an open source WYSIWYG editor as an internship project that made it to production and was adopted by the company I was working at.
git clone https://unitehenry.com/git/striven-editor.git
Log | Files | Refs | README | LICENSE

webpack.config.js (1793B)


      1 const { version } = require('./package.json');
      2 const webpack = require('webpack');
      3 
      4 const path = require('path');
      5 const TerserPlugin = require('terser-webpack-plugin');
      6 const VueLoaderPlugin = require('vue-loader/lib/plugin');
      7 
      8 module.exports = {
      9     mode: 'development',
     10     entry: {
     11         index: './src/index.js',
     12         striveneditor: './src/striveneditor.js',
     13         'ko-striveneditor': './src/ko-striveneditor.js',
     14         'vue-striveneditor': './src/vue-striveneditor.vue'
     15     },
     16     output: {
     17         path: path.resolve(__dirname, "dist"),
     18         filename: '[name].js',
     19         library: 'striveneditor',
     20         libraryTarget: 'umd2'
     21     },
     22     module: {
     23         rules: [
     24             {
     25                 test: /\.m?js$/,
     26                 exclude: /(node_modules|bower_components)/,
     27                 use: {
     28                     loader: 'babel-loader',
     29                     options: {
     30                         presets: ['@babel/preset-env'],
     31                         plugins: ['@babel/plugin-transform-modules-umd']
     32                     }
     33                 }
     34             },
     35             {
     36                 test: /\.css$/i,
     37                 use: ['style-loader', 'css-loader'],
     38             },
     39             {
     40                 test: /\.vue$/,
     41                 loader: 'vue-loader'
     42             }
     43         ]
     44     },
     45     plugins: [
     46         new webpack.DefinePlugin({'__VERSION__': JSON.stringify(version)}), 
     47         new VueLoaderPlugin()
     48     ],
     49     optimization: {
     50         minimize: true,
     51         minimizer: [new TerserPlugin({
     52             exclude: 'index',
     53             terserOptions: {
     54                 output: {
     55                     comments: /@license/i,
     56                 },
     57             },
     58             extractComments: true,
     59         })]
     60     }
     61 };