Skip to content

feat(template-webpack-plugin): apply inlineScripts to WebEncodePlugin#1231

Closed
Aditya-PS-05 wants to merge 1 commit intolynx-family:mainfrom
Aditya-PS-05:feat/apply-inlineScripts-to-WebEncodePlugin
Closed

feat(template-webpack-plugin): apply inlineScripts to WebEncodePlugin#1231
Aditya-PS-05 wants to merge 1 commit intolynx-family:mainfrom
Aditya-PS-05:feat/apply-inlineScripts-to-WebEncodePlugin

Conversation

@Aditya-PS-05
Copy link
Copy Markdown

Closes #1228

Summary

  • Apply inlineScripts functionality to WebEncodePlugin to match the capabilities of LynxEncodePlugin. This feature allows fine-grained control over which scripts should be inlined into the web bundle versus kept as external files.

Changes Made

Core Implementation

  • Added WebEncodePluginOptions interface with encodeBinary and inlineScripts properties
  • Implemented InlineChunkConfig type support for boolean, RegExp, function, and object configurations
  • Added constructor to accept options with default values (inlineScripts: true, encodeBinary: 'napi')
  • Implemented #shouldInlineScript method with identical logic to LynxEncodePlugin

API Usage

new WebEncodePlugin({
  inlineScripts: true,  // boolean
})

new WebEncodePlugin({
  inlineScripts: /background\.js$/,  // RegExp
})

new WebEncodePlugin({
  inlineScripts: ({ name, size }) => size < 1000,  // function
})

new WebEncodePlugin({
  inlineScripts: {  // object
    enable: true,
    test: /background\.js$/
  }
})

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

References

@Aditya-PS-05 Aditya-PS-05 requested a review from colinaaa as a code owner July 7, 2025 05:54
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jul 7, 2025

⚠️ No Changeset found

Latest commit: fd56e8d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Aditya-PS-05 Aditya-PS-05 closed this by deleting the head repository Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: apply inlineScripts to WebEncodePlugin

1 participant