1.2.0 • Published 5 years ago
build-tools-webpack-files v1.2.0
build-tools-webpack-files
Set of tools and utilities to work with static assets (icons, images, fonts and html) in webpack.
Install
npm install --save-dev build-tools-webpack-filesUsage
In webpack.config.js:
const { rules: fileRules } = require('build-tools-webpack-files');
module.exports = {
module: {
rules: [
...fileRules,
... // other loaders
]
}
};Or neat-pick specific loaders:
const { rules: htmlRules } = require('build-tools-webpack-files/html');
module.exports = {
module: {
rules: [
...htmlRules,
... // other loaders
]
}
};List of loaders:
- Fonts:
woff,woff2,ttf,eot. - HTML:
html. - Images:
png,jpg,gif. - JSON:
json. - SVG:
svg. - YAML:
yaml.
Note: the package main file groups fonts, HTML, and image loaders, however, JSON, SVG, and YAML must be loaded separately (see usage section).