help with excluding a 10mb file from obfuscation
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- javascript, typescript, webpack
- Domínio
- build-system
Direção de pesquisa
Comece revisando o arquivo reportado foe-info-low-webpack.config.js e a documentação do webpack-obfuscator sobre como as exclusões são configuradas. O relatório diz que o build trava em 92% durante o WebpackObfuscator após a adição de src/js/data/cityEntities.js; determine se o arquivo ainda está sendo processado e confirme um npm run build-lowtool concluído com sucesso com esses dados incluídos.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
hi guys, i'v been having trouble building my chrome extension ever since i included a 10mb file that contains the data about all event buildings in a video game ... before i was able to dynamically load it, but now dynamic loading doesn't work for me as the game itself changed something, so as a temporary fix i downloaded the file and placed it in /src/js/data/cityEntities.js ... ever since doing that, when i run npm run build-lowtool the build gets stuck at:
❯ npm run build-lowtool
> [email protected] build-lowtool
> webpack --config foe-info-low-webpack.config.js
92% sealing asset processing WebpackObfuscator
while when i revert the inclusion of that file, the build builds succesfully ...
so i'v looked up trough your readme on how to exclude a file from obfuscation, and did exactly that ... but still my build process gets stuck at 92% and takes forever to do it ...
this is my foe-info-low-webpack.config.js
var webpack = require("webpack"),
path = require("path"),
fileSystem = require("fs");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const CopyPlugin = require("copy-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const WebpackExtensionManifestPlugin = require("webpack-extension-manifest-plugin");
const baseManifest = require("./src/chrome/manifest-low.json");
const pkg = require("./package.json");
const TerserPlugin = require("terser-webpack-plugin");
var JavaScriptObfuscator = require("webpack-obfuscator");
var ZipPlugin = require("zip-webpack-plugin");
const PACKAGE_NAME = "LoW-Tool";
const date = new Date().toISOString().substr(0, 10);
// const PUBLIC_PATH = process.env.PUBLIC_PATH || '/';
module.exports = {
mode: "production",
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
ecma: 6,
parse: {},
compress: {
pure_funcs: ["console.info", "console.debug"],
},
format: {
comments: false,
},
mangle: true,
module: true,
// Deprecated
output: null,
format: null,
toplevel: false,
nameCache: null,
ie8: false,
keep_classnames: false,
keep_fnames: false,
safari10: false,
},
extractComments: false,
}),
],
},
entry: {
app: "./src/extras/index.js",
options: "./src/js/options.js",
devtools: "./src/js/devtools.js",
popup: "./src/js/popup.js",
},
module: {
rules: [
{
test: /\.js$/,
exclude: path.resolve(__dirname, "/node_modules", "/src/js/data/cityEntities.js"),
// `.swcrc` can be used to configure swc
},
{
test: /\.(sa|sc|c)ss$/,
use: [MiniCssExtractPlugin.loader, "css-loader", "postcss-loader", "sass-loader"],
},
{
test: /\.(png|svg|jpg|gif)$/,
use: ["file-loader"],
},
],
},
output: {
filename: "[name].js",
chunkFilename: "[name].js",
path: path.resolve(__dirname, "build/" + PACKAGE_NAME),
publicPath: "/",
},
plugins: [
new MiniCssExtractPlugin(),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
}),
new webpack.ProgressPlugin(),
// clean the build folder
new CleanWebpackPlugin({
verbose: true,
cleanStaleWebpackAssets: true,
}),
new webpack.DefinePlugin({
// Definitions...
EXT_NAME: JSON.stringify(PACKAGE_NAME),
DEV: false,
}),
new HtmlWebpackPlugin({
title: PACKAGE_NAME,
manifest: "manifest.json",
filename: "panel.html",
template: "./src/chrome/panel.html",
chunks: ["app"],
hash: true,
}),
new HtmlWebpackPlugin({
title: PACKAGE_NAME,
filename: "options.html",
template: "./src/chrome/options.html",
chunks: ["options"],
}),
new HtmlWebpackPlugin({
title: PACKAGE_NAME,
filename: "popup.html",
template: "./src/chrome/popup.html",
chunks: ["popup"],
}),
new HtmlWebpackPlugin({
title: PACKAGE_NAME,
filename: "devtools.html",
template: "./src/chrome/devtools.html",
chunks: ["devtools"],
}),
new CopyPlugin({
patterns: [
{
from: "node_modules/webextension-polyfill/dist/browser-polyfill.min.js",
},
{ from: "./src/i18n", to: "i18n" },
{ from: "./src/icons/common", to: "icons" },
{ from: "./src/icons/foe-info-low", to: "icons" },
{ from: "src/images/logo90.png", to: "icons/" },
],
}),
new WebpackExtensionManifestPlugin({
config: {
base: baseManifest,
extend: {
version: pkg.version,
name: PACKAGE_NAME,
short_name: PACKAGE_NAME,
},
},
}),
new JavaScriptObfuscator(
{
compact: true,
controlFlowFlattening: true,
controlFlowFlatteningThreshold: 0.75,
deadCodeInjection: true,
deadCodeInjectionThreshold: 0.4,
disableConsoleOutput: true,
identifierNamesGenerator: "hexadecimal",
log: false,
numbersToExpressions: true,
renameGlobals: true,
rotateStringArray: true,
selfDefending: true,
shuffleStringArray: true,
simplify: true,
splitStrings: true,
splitStringsChunkLength: 10,
stringArray: true,
stringArrayEncoding: ["base64"],
stringArrayThreshold: 0.75,
transformObjectKeys: true,
unicodeEscapeSequence: false,
},
["excluded_bundle_name.js"]
),
new ZipPlugin({
// OPTIONAL: defaults to the Webpack output path (above)
// can be relative (to Webpack output path) or absolute
path: "../",
// OPTIONAL: defaults to the Webpack output filename (above) or,
// if not present, the basename of the path
filename: PACKAGE_NAME + "_" + pkg.version + "_" + date + ".zip",
}),
],
resolve: {
extensions: [".tsx", ".ts", ".js"],
fallback: {
fs: false,
},
},
};
I'd appreciate any help making the build process actually work, did i exclude /src/js/data/cityEntities.js the proper way?
- Linguagem predominante
- TypeScript
- Estrelas
- 930
- Forks
- 92
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de javascript-obfuscator/webpack-obfuscator
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 25/100
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
javascript-obfuscator/webpack-obfuscator#180 · 2 comentários ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 35/100
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
Todas as issues de javascript-obfuscator/webpack-obfuscator
Issues semelhantes
-
Navbar avatar and name stay stale after saving profile changesTalvez já em andamento @alexechoi assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
marmelab/atomic-crm#416 ·
Mantenedores costumam responder em até 1 dia
-
feature-request
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
bluesky-social/social-app#12343 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
lucide-icons/lucide#5165 ·
Mantenedores costumam responder em até 1 dia
-
[Feature] Preferences - Keep the theme selection popover open after selection for quick previewAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
marktext/marktext#6033 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
area:desktop bug has repro platform:macos
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
anthropics/claude-code#107903 ·