-
Notifications
You must be signed in to change notification settings - Fork 3.1k
gui webpack_attempts
KernelDeimos edited this page Feb 25, 2025
·
1 revision
Multiple things attempted when trying to add icons to the bundle.
None of this worked - eventually just prepended text on emit instead.
// compilation.hooks.processAssets.tap(
// {
// name: 'AddImportPlugin',
// stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS,
// },
// (assets) => {
// for (const assetName of Object.keys(assets)) {
// if (assetName.endsWith('.js')) {
// const source = assets[assetName].source();
// const newSource = `${icons}\n${source}`;
// compilation.updateAsset(assetName, new compiler.webpack.sources.RawSource(newSource));
// }
// }
// }
// );
// Inject into bundle
// console.log('adding this:' + icons);
// compilation.assets['icons-thing'] = {
// source: () => icons,
// size: () => icons.length,
// };
// compilation.addModule({
// identifier() {
// return 'icons-thing';
// },
// build() {
// this._source = {
// source() {
// return content;
// },
// size() {
// return content.length;
// }
// };
// }
// });
// Add the generated module to Webpack's internal modules
// compilation.hooks.optimizeModules.tap('IconsPlugin', (modules) => {
// const virtualModule = {
// identifier: () => 'icons.js',
// readableIdentifier: () => 'icons.js',
// build: () => {},
// source: () => icons,
// size: () => icons.length,
// chunks: [],
// assets: [],
// hash: () => 'icons',
// };
// modules.push(virtualModule);
// });
});
// this.hooks.entryOption.tap('IconsPlugin', (context, entry) => {
// entry.main.import.push('icons-thing');
// });
// this.hooks.make.tapAsync('InjectTextEntryPlugin', (compilation, callback) => {
// // Create a new asset (fake module) from the generated content
// const content = `console.log('${this.options.text}');`;
// callback();
// });
// this.hooks.entryOption.tap('IconsPlugin', (context, entry) => {
// });
// this.hooks.entryOption.tap('InjectTextEntryPlugin', (context, entry) => {
// // Add this as an additional entry point
// this.options.entry = {
// ...this.options.entry,
// 'generated-entry': '// FINDME\n'
// };
// });
This wiki is generated from the repository. Do not edit files the wiki.
You are reading documentation for Puter, an open-source high-level operating system.
Getting started with Puter on localhost is as simple as:
git clone https://github.com/HeyPuter/puter.git
npm install
npm run start
- Index (README.md)
- api drivers
- Group Endpoints
- Notification Endpoints
- Share Endpoints
- Type-Tagged Objects
- Comment Prefixes
- contributors vscode
- Local Email Testing
- Puter Extensions
- Repository Structure and Tooling
- Configuring Domains for Self-Hosted Puter
- Configuring Puter
- First Run Issues
- self_hosters config_values
- self_hosters support
- Self-Hosting Puter
- Backend Style
- Puter Backend - Directory Structure
- Puter Backend Boot Sequence
- Puter Kernel Moduels and Services
- Batch and Symlinks
- Metered Services and Cost Management
- Protected Apps and Subdomains
- Service Scripts
- Index (README.md)
- Configuring AI Services
- PuterAI API Request Examples
- src backend src modules puterai config
####### For Contributors