PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.11.10
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.11.10
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 All 149 releases
← All changes | classes/Visualizer/Gutenberg/webpack.config.js +95 -77 3.10.03.11.10 View file →
@@ -1,90 +1,108 @@
1 -const webpack = require( 'webpack' );
1 +const webpack = require('webpack');
2 2 const NODE_ENV = process.env.NODE_ENV || 'development';
3 -const MiniCssExtractPlugin = require( 'mini-css-extract-plugin' );
3 +const MiniCssExtractPlugin = require('mini-css-extract-plugin');
4 +const TerserPlugin = require('terser-webpack-plugin');
4 5
5 6 module.exports = {
6 - mode: NODE_ENV,
7 - entry: './src/index.js',
8 - output: {
9 - path: __dirname,
10 - filename: './build/block.js',
11 - chunkFilename: './build/[name].js'
12 - },
13 - module: {
14 - rules: [
15 - {
16 - test: /.js?$/,
17 - use: [ {
18 - loader: 'babel-loader',
19 - options: {
20 - presets: [ '@babel/preset-env' ],
21 - plugins: [
22 - '@babel/plugin-transform-async-to-generator',
23 - '@babel/plugin-proposal-object-rest-spread',
24 - [
25 - '@babel/plugin-transform-react-jsx', {
26 - 'pragma': 'wp.element.createElement'
27 - }
28 - ]
29 - ]
30 - }
31 - },
32 - 'eslint-loader' ],
33 - exclude: /node_modules/
34 - },
35 - {
36 - test: /\.(css|scss)$/,
37 - use: [ {
38 - loader: MiniCssExtractPlugin.loader
39 - },
40 - 'css-loader',
41 - {
42 - loader: 'postcss-loader',
43 - options: {
44 - plugins: [
45 - require( 'autoprefixer' )
46 - ]
47 - }
48 - },
49 - {
50 - loader: 'sass-loader',
51 - query: {
52 - outputStyle:
53 - 'production' === process.env.NODE_ENV ? 'compressed' : 'nested'
54 - }
55 - } ]
56 - },
57 - {
58 - test: /\.(png|jpe?g|gif)$/,
59 - use: [
60 - {
61 - loader: 'file-loader',
62 - options: {
63 - name: './[name].[ext]'
64 - }
65 - }
66 - ]
67 - }
68 - ]
69 - },
70 - optimization: {
7 + externals: {
8 + 'lodash': 'lodash'
9 + },
10 + mode: NODE_ENV,
11 + entry: {
12 + block: './src/index.js'
13 + },
14 + output: {
15 + path: __dirname,
16 + filename: './build/[name].js'
17 + },
18 + module: {
19 + rules: [
20 + {
21 + test: /\.js$/,
22 + use: {
23 + loader: 'babel-loader',
24 + options: {
25 + presets: ['@babel/preset-env'],
26 + plugins: [
27 + '@babel/plugin-transform-async-to-generator',
28 + '@babel/plugin-proposal-object-rest-spread',
29 + [
30 + '@babel/plugin-transform-react-jsx', {
31 + 'pragma': 'wp.element.createElement'
32 + }
33 + ]
34 + ]
35 + }
36 + },
37 + exclude: /node_modules/
38 + },
39 + {
40 + test: /\.(css|scss)$/,
41 + use: [
42 + {
43 + loader: MiniCssExtractPlugin.loader
44 + },
45 + 'css-loader',
46 + {
47 + loader: 'postcss-loader',
48 + options: {
49 + postcssOptions: {
50 + plugins: [
51 + require('autoprefixer')
52 + ]
53 + }
54 + }
55 + },
56 + {
57 + loader: 'sass-loader',
58 + options: {
59 + implementation: require('sass'),
60 + sassOptions: {
61 + outputStyle: NODE_ENV === 'production' ? 'compressed' : 'expanded'
62 + }
63 + }
64 + }
65 + ]
66 + },
67 + {
68 + test: /\.(png|jpe?g|gif)$/,
69 + use: [
70 + {
71 + loader: 'file-loader',
72 + options: {
73 + name: './[name].[ext]'
74 + }
75 + }
76 + ]
77 + }
78 + ]
79 + },
80 + optimization: {
71 81 splitChunks: {
72 82 cacheGroups: {
73 83 handsontable: {
74 84 name: 'handsontable',
75 85 test: /[\\/]node_modules[\\/]handsontable/,
76 - chunks: 'all'
86 + chunks: 'all',
87 + enforce: true
77 88 }
78 89 }
79 90 }
80 91 },
81 - plugins: [
82 - new webpack.DefinePlugin({
83 - 'process.env.NODE_ENV': JSON.stringify( NODE_ENV )
84 - }),
85 - new MiniCssExtractPlugin({
86 - filename: './build/block.css',
87 - chunkFilename: './build/[name].css'
88 - })
89 - ]
92 + plugins: [
93 + new webpack.DefinePlugin({
94 + 'process.env.NODE_ENV': JSON.stringify(NODE_ENV)
95 + }),
96 + new MiniCssExtractPlugin({
97 + filename: './build/[name].css'
98 + }),
99 + new TerserPlugin({
100 + terserOptions: {
101 + format: {
102 + comments: false // Disable comments
103 + }
104 + },
105 + extractComments: false // Prevents LICENSE.txt generation
106 + })
107 + ]
90 108 };