browser-extension-manager 1.3.21 → 1.3.22

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.
@@ -177,23 +177,27 @@ function getSettings() {
177
177
  {
178
178
  test: /\.js$/,
179
179
  exclude: /node_modules/,
180
- use: {
181
- loader: 'babel-loader',
182
- options: {
183
- sourceMaps: !Manager.actLikeProduction(),
184
- presets: [
185
- [require.resolve('@babel/preset-env', {
186
- paths: [path.resolve(process.cwd(), 'node_modules', package.name, 'node_modules')]
187
- }), {
188
- exclude: [
189
- // Prevent lighthouse error in 2025 about Legacy JavaScript
190
- // 'es.array.from',
191
- ]
192
- }]
193
- ],
194
- compact: Manager.isBuildMode(),
195
- }
196
- }
180
+ use: [
181
+ {
182
+ loader: 'babel-loader',
183
+ options: {
184
+ sourceMaps: !Manager.actLikeProduction(),
185
+ presets: [
186
+ [require.resolve('@babel/preset-env', {
187
+ paths: [path.resolve(process.cwd(), 'node_modules', package.name, 'node_modules')]
188
+ }), {
189
+ exclude: [
190
+ // Prevent lighthouse error in 2025 about Legacy JavaScript
191
+ // 'es.array.from',
192
+ ]
193
+ }]
194
+ ],
195
+ compact: Manager.isBuildMode(),
196
+ }
197
+ },
198
+ // Strip dev-only blocks before babel processes the file
199
+ stripDevBlocksLoader,
200
+ ]
197
201
  }
198
202
  ]
199
203
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browser-extension-manager",
3
- "version": "1.3.21",
3
+ "version": "1.3.22",
4
4
  "description": "Browser Extension Manager dependency manager",
5
5
  "main": "dist/index.js",
6
6
  "exports": {
@@ -1,53 +0,0 @@
1
- // Plugin: StripDevBlocksPlugin
2
- class StripDevBlocksPlugin {
3
- constructor(options = {}) {
4
- this.options = Object.assign(
5
- {
6
- fileTest: /\.js$/,
7
- startMarker: '/* @dev-only:start */',
8
- endMarker: '/* @dev-only:end */',
9
- },
10
- options
11
- )
12
- this.enabled = process.env.BEM_BUILD_MODE === 'true'
13
- }
14
-
15
- apply(compiler) {
16
- if (!this.enabled) return
17
-
18
- compiler.hooks.compilation.tap('StripDevBlocksPlugin', (compilation) => {
19
- compilation.hooks.processAssets.tap(
20
- {
21
- name: 'StripDevBlocksPlugin',
22
- stage: compilation.PROCESS_ASSETS_STAGE_OPTIMIZE,
23
- },
24
- (assets) => {
25
- for (const filename in assets) {
26
- if (!this.options.fileTest.test(filename)) continue
27
-
28
- let source = assets[filename].source()
29
-
30
- // Strip everything between start and end marker
31
- const pattern = new RegExp(
32
- `${this.escape(this.options.startMarker)}[\\s\\S]*?${this.escape(this.options.endMarker)}`,
33
- 'g'
34
- )
35
- source = source.replace(pattern, '')
36
-
37
- compilation.updateAsset(
38
- filename,
39
- new compiler.webpack.sources.RawSource(source)
40
- )
41
- }
42
- }
43
- )
44
- })
45
- }
46
-
47
- escape(str) {
48
- return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
49
- }
50
- }
51
-
52
- // Export
53
- module.exports = StripDevBlocksPlugin