Skip to content

privatenumber/code-inject-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

code-inject-loader

Inject code to certain files

How to use

Add as a loader rule to configure which files the loader should inject code into.

webpack.config.js

moule.exports = {
	...,

	module: {
		rules: [
			{
				test: /src/,
				loader: 'code-inject-loader',
				options: {
					prepend: `console.log('Hello Im in every file');`
				},
			},
			...
		]
	},

	...
}

Options

  • prepend Add code to the beginning of the file
  • append Add code to the bottom of the file
  • transform(source) Function to make changes to the source code of the file

About

Inject code to certain files

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published