Add semantic token highlighting for 'that' variable and comment file references in VS Code extension Add Phone_Text_Input and Currency_Input components with formatting utilities Implement client widgets, form standardization, and soft delete functionality Add modal scroll lock and update documentation Implement comprehensive modal system with form integration and validation Fix modal component instantiation using jQuery plugin API Implement modal system with responsive sizing, queuing, and validation support Implement form submission with validation, error handling, and loading states Implement country/state selectors with dynamic data loading and Bootstrap styling Revert Rsx::Route() highlighting in Blade/PHP files Target specific PHP scopes for Rsx::Route() highlighting in Blade Expand injection selector for Rsx::Route() highlighting Add custom syntax highlighting for Rsx::Route() and Rsx.Route() calls Update jqhtml packages to v2.2.165 Add bundle path validation for common mistakes (development mode only) Create Ajax_Select_Input widget and Rsx_Reference_Data controller Create Country_Select_Input widget with default country support Initialize Tom Select on Select_Input widgets Add Tom Select bundle for enhanced select dropdowns Implement ISO 3166 geographic data system for country/region selection Implement widget-based form system with disabled state support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
106 lines
2.9 KiB
JavaScript
Executable File
106 lines
2.9 KiB
JavaScript
Executable File
/*
|
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
Author Tobias Koppers @sokra
|
|
*/
|
|
|
|
"use strict";
|
|
|
|
const RawModule = require("./RawModule");
|
|
const EntryDependency = require("./dependencies/EntryDependency");
|
|
const createSchemaValidation = require("./util/create-schema-validation");
|
|
|
|
/** @typedef {import("../declarations/plugins/IgnorePlugin").IgnorePluginOptions} IgnorePluginOptions */
|
|
/** @typedef {import("./Compiler")} Compiler */
|
|
/** @typedef {import("./NormalModuleFactory").ResolveData} ResolveData */
|
|
/** @typedef {import("./ContextModuleFactory").BeforeContextResolveData} BeforeContextResolveData */
|
|
|
|
const validate = createSchemaValidation(
|
|
require("../schemas/plugins/IgnorePlugin.check"),
|
|
() => require("../schemas/plugins/IgnorePlugin.json"),
|
|
{
|
|
name: "Ignore Plugin",
|
|
baseDataPath: "options"
|
|
}
|
|
);
|
|
|
|
/** @typedef {(resource: string, context: string) => boolean} CheckResourceFn */
|
|
|
|
const PLUGIN_NAME = "IgnorePlugin";
|
|
|
|
class IgnorePlugin {
|
|
/**
|
|
* @param {IgnorePluginOptions} options IgnorePlugin options
|
|
*/
|
|
constructor(options) {
|
|
validate(options);
|
|
this.options = options;
|
|
this.checkIgnore = this.checkIgnore.bind(this);
|
|
}
|
|
|
|
/**
|
|
* Note that if "contextRegExp" is given, both the "resourceRegExp" and "contextRegExp" have to match.
|
|
* @param {ResolveData | BeforeContextResolveData} resolveData resolve data
|
|
* @returns {false | undefined} returns false when the request should be ignored, otherwise undefined
|
|
*/
|
|
checkIgnore(resolveData) {
|
|
if (
|
|
"checkResource" in this.options &&
|
|
this.options.checkResource &&
|
|
this.options.checkResource(resolveData.request, resolveData.context)
|
|
) {
|
|
return false;
|
|
}
|
|
|
|
if (
|
|
"resourceRegExp" in this.options &&
|
|
this.options.resourceRegExp &&
|
|
this.options.resourceRegExp.test(resolveData.request)
|
|
) {
|
|
if ("contextRegExp" in this.options && this.options.contextRegExp) {
|
|
// if "contextRegExp" is given,
|
|
// both the "resourceRegExp" and "contextRegExp" have to match.
|
|
if (this.options.contextRegExp.test(resolveData.context)) {
|
|
return false;
|
|
}
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Apply the plugin
|
|
* @param {Compiler} compiler the compiler instance
|
|
* @returns {void}
|
|
*/
|
|
apply(compiler) {
|
|
compiler.hooks.normalModuleFactory.tap(PLUGIN_NAME, (nmf) => {
|
|
nmf.hooks.beforeResolve.tap(PLUGIN_NAME, (resolveData) => {
|
|
const result = this.checkIgnore(resolveData);
|
|
|
|
if (
|
|
result === false &&
|
|
resolveData.dependencies.length > 0 &&
|
|
resolveData.dependencies[0] instanceof EntryDependency
|
|
) {
|
|
const module = new RawModule(
|
|
"",
|
|
"ignored-entry-module",
|
|
"(ignored-entry-module)"
|
|
);
|
|
module.factoryMeta = { sideEffectFree: true };
|
|
|
|
resolveData.ignoredModule = module;
|
|
}
|
|
|
|
return result;
|
|
});
|
|
});
|
|
compiler.hooks.contextModuleFactory.tap(PLUGIN_NAME, (cmf) => {
|
|
cmf.hooks.beforeResolve.tap(PLUGIN_NAME, this.checkIgnore);
|
|
});
|
|
}
|
|
}
|
|
|
|
module.exports = IgnorePlugin;
|