https://github.com/josuerios/assets-inject-webpack-plugin
https://github.com/josuerios/assets-inject-webpack-plugin
inject plugin webpack
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/josuerios/assets-inject-webpack-plugin
- Owner: josuerios
- License: mit
- Created: 2017-07-28T19:31:31.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T14:39:40.000Z (over 2 years ago)
- Last Synced: 2025-06-05T00:28:28.627Z (about 1 year ago)
- Topics: inject, plugin, webpack
- Language: JavaScript
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# assets-inject-webpack-plugin
Inject assets into any kind of template, using the core implementation of [gulp-inject](https://github.com/klei/gulp-inject).
In fact the plugin constructor uses the API of gulp-inject.
## Usage
````js
const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const AssetsInjectPlugin = require('assets-inject-webpack-plugin');
//same options object of [gulp-inject](https://github.com/klei/gulp-inject)
const injectOpt = {addPrefix:'my-app'};
const config = {
entry: {
app: './src/client/index.js',
print: './src/client/print.js',
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist')
},
plugins: [
new CleanWebpackPlugin(['dist']),
new AssetsInjectPlugin('./src/server/layout/layout.jade', injectOpt)
]
};
module.exports = config;
````
## List of compatible file template types:
* Jade/Pug `.jade/.pug`
* HTML `.html`
* JSX `.jsx`
* LESS `.less`
* SASS/SCSS `.sass/.scss`
Contribute
===============
Commit Messages
-------
Rules are adopted from [the AngularJS commit conventions](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/).