All Projects → sindresorhus → Add Asset Webpack Plugin

sindresorhus / Add Asset Webpack Plugin

Licence: mit
Dynamically add an asset to the Webpack graph

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Add Asset Webpack Plugin

Node Env Webpack Plugin
Simplified `NODE_ENV` handling with webpack
Stars: ✭ 51 (-39.29%)
Mutual labels:  webpack, webpack-plugin, npm-package
Express React Boilerplate
🚀🚀🚀 This is a tool that helps programmers create Express & React projects easily base on react-cool-starter.
Stars: ✭ 32 (-61.9%)
Mutual labels:  webpack, npm-package
Page Builder
自定义页面构建平台
Stars: ✭ 81 (-3.57%)
Mutual labels:  webpack, webpack-plugin
Dotenv Webpack
A secure webpack plugin that supports dotenv and other environment variables and only exposes what you choose and use.
Stars: ✭ 1,022 (+1116.67%)
Mutual labels:  webpack, webpack-plugin
Cloudflare Workers Webpack Plugin
Launch Cloudflare Workers to the Edge from the comfort of your build step 🚀
Stars: ✭ 18 (-78.57%)
Mutual labels:  webpack, webpack-plugin
Webpack Common Shake
CommonJS Tree Shaker plugin for WebPack
Stars: ✭ 875 (+941.67%)
Mutual labels:  webpack, webpack-plugin
Webpack Aliyun Oss
一个webpack(version >= 4)插件,上传资源到阿里云oss。可以作为webpack插件使用,也可独立使用
Stars: ✭ 36 (-57.14%)
Mutual labels:  webpack, webpack-plugin
Duplicate Package Checker Webpack Plugin
🕵️ Webpack plugin that warns you when a build contains multiple versions of the same package
Stars: ✭ 635 (+655.95%)
Mutual labels:  webpack, webpack-plugin
Node Native Ext Loader
Loader for Node native extensions
Stars: ✭ 51 (-39.29%)
Mutual labels:  webpack, npm-package
Html Inline Css Webpack Plugin
☄️ A webpack plugin for convert external stylesheet to the embedded stylesheet
Stars: ✭ 48 (-42.86%)
Mutual labels:  webpack, webpack-plugin
Prerender Spa Plugin
Prerenders static HTML in a single-page application.
Stars: ✭ 7,018 (+8254.76%)
Mutual labels:  webpack, webpack-plugin
Wcer
Webpack plugin to enable reloading while developing Chrome extensions.
Stars: ✭ 71 (-15.48%)
Mutual labels:  webpack, webpack-plugin
Error Overlay Webpack Plugin
Catch errors with style 💥✨
Stars: ✭ 821 (+877.38%)
Mutual labels:  webpack, webpack-plugin
Event Hooks Webpack Plugin
Event hooks plugin for webpack
Stars: ✭ 30 (-64.29%)
Mutual labels:  webpack, webpack-plugin
Bundlephobia
🏋️ Find out the cost of adding a new frontend dependency to your project
Stars: ✭ 6,640 (+7804.76%)
Mutual labels:  webpack, npm-package
Webpack Alioss Plugin
阿里 oss-webpack 自动上传插件
Stars: ✭ 35 (-58.33%)
Mutual labels:  webpack, webpack-plugin
Webpack Config Plugins
Provide best practices for webpack loader configurations
Stars: ✭ 529 (+529.76%)
Mutual labels:  webpack, webpack-plugin
Webpack Deep Scope Analysis Plugin
A webpack plugin for deep scope analysis
Stars: ✭ 589 (+601.19%)
Mutual labels:  webpack, webpack-plugin
Webpack Webextension Plugin
Webpack plugin that compiles WebExtension manifest.json files and adds smart auto reload
Stars: ✭ 47 (-44.05%)
Mutual labels:  webpack, webpack-plugin
Snackui
SnackUI 🍑 - the final React style library. With an *optimizing compiler* that lets you write views naturally, with easier DX, working on native and web at once, all while being faster than hand-rolling your own CSS.
Stars: ✭ 55 (-34.52%)
Mutual labels:  webpack, webpack-plugin

add-asset-webpack-plugin Build Status

Dynamically add an asset to the Webpack graph

Install

$ npm install add-asset-webpack-plugin

Usage

const AddAssetPlugin = require('add-asset-webpack-plugin');

module.exports = {
	// …
	plugins: [
		new AddAssetPlugin('file.js', `
			console.log('This is a dynamically created file');
		`)
	]
};

API

AddAssetPlugin(filePath, source)

filePath

Type: string

Relative file path for the asset.

source

Type: string | (compilation => string | Promise<string>)

Asset source or a function that returns the asset source.

If a function, it will receive the compilation instance. And if the function returns a promise, it will be awaited.

Related

License

MIT © Sindre Sorhus

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].