@plaudit/webpack-extensions 2.0.0-beta.8 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,6 +6,7 @@ const node_fs_1 = __importDefault(require("node:fs"));
|
|
|
6
6
|
const node_path_1 = __importDefault(require("node:path"));
|
|
7
7
|
const AdditionalDependencyInjectorPlugin_1 = __importDefault(require("./wordpress-scripts-wrapper/AdditionalDependencyInjectorPlugin"));
|
|
8
8
|
const BlockJSONStyleRemappingPlugin_1 = __importDefault(require("./wordpress-scripts-wrapper/BlockJSONStyleRemappingPlugin"));
|
|
9
|
+
const browser_sync_webpack_plugin_1 = __importDefault(require("browser-sync-webpack-plugin"));
|
|
9
10
|
const copy_webpack_plugin_1 = __importDefault(require("copy-webpack-plugin"));
|
|
10
11
|
const fork_ts_checker_webpack_plugin_1 = __importDefault(require("fork-ts-checker-webpack-plugin"));
|
|
11
12
|
const webpack_remove_empty_scripts_1 = __importDefault(require("webpack-remove-empty-scripts"));
|
|
@@ -134,6 +135,7 @@ module.exports = function (config, webpackConfig = require("@wordpress/scripts/c
|
|
|
134
135
|
}
|
|
135
136
|
}
|
|
136
137
|
}
|
|
138
|
+
let first = true;
|
|
137
139
|
const sources = Array.isArray(config.src) ? config.src.map(s => [s, s]) : Object.entries(config.src);
|
|
138
140
|
return sources.map(([src, dest]) => {
|
|
139
141
|
const srcRoots = src.split(',');
|
|
@@ -153,6 +155,17 @@ module.exports = function (config, webpackConfig = require("@wordpress/scripts/c
|
|
|
153
155
|
plugins.push(new BlockJSONStyleRemappingPlugin_1.default());
|
|
154
156
|
}
|
|
155
157
|
plugins.push(new AdditionalDependencyInjectorPlugin_1.default());
|
|
158
|
+
if (first) {
|
|
159
|
+
first = false;
|
|
160
|
+
if (process.argv.includes('--browser-sync')) {
|
|
161
|
+
plugins.push(new browser_sync_webpack_plugin_1.default({
|
|
162
|
+
host: 'localhost',
|
|
163
|
+
port: 3000,
|
|
164
|
+
https: true,
|
|
165
|
+
proxy: 'https://localhost:8443'
|
|
166
|
+
}));
|
|
167
|
+
}
|
|
168
|
+
}
|
|
156
169
|
let entry;
|
|
157
170
|
if (srcIsDirectory) {
|
|
158
171
|
entry = node_fs_1.default.readdirSync(srcRoot, 'utf8')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plaudit/webpack-extensions",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"prepublishOnly": "rm -rf build && mkdir build && tsc",
|
|
6
6
|
"build": "tsc",
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
"./wordpress-scripts-wrapper": "./build/wordpress-scripts-wrapper.js"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
+
"@types/browser-sync-webpack-plugin": "^2.2.2",
|
|
16
17
|
"@types/node": "^20.2.5",
|
|
18
|
+
"@types/tapable": "^2.2.3",
|
|
17
19
|
"@types/webpack": "^5.28.1",
|
|
18
20
|
"@types/webpack-sources": "^3.2.0",
|
|
19
21
|
"postcss-load-config": "^4.0.1",
|
|
@@ -28,6 +30,8 @@
|
|
|
28
30
|
"@plaudit/postcss-variables": "^1.0.0",
|
|
29
31
|
"@wordpress/scripts": "^26.6.0",
|
|
30
32
|
"autoprefixer": "^10.4.14",
|
|
33
|
+
"browser-sync": "^2.29.3",
|
|
34
|
+
"browser-sync-webpack-plugin": "^2.3.0",
|
|
31
35
|
"clean-webpack-plugin": "^4.0.0",
|
|
32
36
|
"copy-webpack-plugin": "^11.0.0",
|
|
33
37
|
"cssnano": "^6.0.1",
|