diff options
| author | Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> | 2025-06-13 20:11:35 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-13 20:11:35 +0000 |
| commit | ca20de409d08ec5abe2d3275bb97cfc5e8c164b3 (patch) | |
| tree | a13b48386e20bf69e7ede0bfff4715c17b90549d /config/webpack/plugins/create-rules-webpack-plugin.js | |
| parent | caa9c3f705730886cab911cb241703a10494581c (diff) | |
| parent | 54467df36805eabf9113d1bb84d7434b331cd167 (diff) | |
| download | banglar-bhumi-utils-ca20de409d08ec5abe2d3275bb97cfc5e8c164b3.tar.gz banglar-bhumi-utils-ca20de409d08ec5abe2d3275bb97cfc5e8c164b3.zip | |
Merge pull request #2 from arpitchakladar/dev/porting-to-firefox
Dev/implementing OCR for captcha autofill
Diffstat (limited to 'config/webpack/plugins/create-rules-webpack-plugin.js')
| -rw-r--r-- | config/webpack/plugins/create-rules-webpack-plugin.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/config/webpack/plugins/create-rules-webpack-plugin.js b/config/webpack/plugins/create-rules-webpack-plugin.js index 6e31196..5573ddf 100644 --- a/config/webpack/plugins/create-rules-webpack-plugin.js +++ b/config/webpack/plugins/create-rules-webpack-plugin.js @@ -1,6 +1,6 @@ -const path = require("path"); -const fs = require("fs"); -const { sources } = require("webpack"); +import path from "path"; +import fs from "fs"; +import webpack from "webpack"; class CreateRulesPlugin { apply(compiler) { @@ -16,7 +16,7 @@ class CreateRulesPlugin { let ruleId = 1; for (const ruleFileName of ruleFileNames) { - const rule = require(path.resolve(SOURCE_DIR, "rules", ruleFileName)); + const rule = JSON.parse(fs.readFileSync(path.resolve("src/rules", ruleFileName))); if (rule instanceof Array) { for (const currentRule of rule) { @@ -31,7 +31,7 @@ class CreateRulesPlugin { compilation.emitAsset( "rules.json", - new sources.RawSource( + new webpack.sources.RawSource( JSON.stringify( rules, undefined, @@ -47,4 +47,4 @@ class CreateRulesPlugin { } } -module.exports = CreateRulesPlugin; +export default CreateRulesPlugin; |
