PluginProbe
Extendify / 3.2.1
Extendify v3.2.1
3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 All 127 releases
extendify / webpack.designer.mjs

webpack.designer.mjs in Extendify 3.2.1, at webpack.designer.mjs

42 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { dirname, resolve } from 'node:path';
2 import { fileURLToPath } from 'node:url';
3 import CopyPlugin from 'copy-webpack-plugin';
4 import MiniCSSExtractPlugin from 'mini-css-extract-plugin';
5 import base from './webpack.config.mjs';
6
7 const __dirname = dirname(fileURLToPath(import.meta.url));
8
9 // Externalizing @wordpress/* is what makes a bundle need WordPress to boot.
10 // The manifest and cleaner would rewrite and empty the plugin's own build dir.
11 const DROP = [
12 'DependencyExtractionWebpackPlugin',
13 'WebpackAssetsManifest',
14 'CleanWebpackPlugin',
15 // Two instances emit the stylesheet twice, once under a hash nothing reads.
16 'MiniCssExtractPlugin',
17 'MiniCSSExtractPlugin',
18 ];
19
20 export default {
21 ...base,
22 entry: { designer: './src/Designer/designer.js' },
23 output: {
24 filename: '[name].js',
25 path: resolve(__dirname, 'designer-dist'),
26 publicPath: './',
27 clean: true,
28 },
29 plugins: [
30 ...base.plugins.filter((p) => !DROP.includes(p.constructor.name)),
31 new MiniCSSExtractPlugin({ filename: '[name].css' }),
32 new CopyPlugin({
33 patterns: [{ from: 'src/Designer/index.html', to: 'index.html' }],
34 }),
35 ],
36 optimization: {
37 ...base.optimization,
38 runtimeChunk: false,
39 splitChunks: false,
40 },
41 };
42