main
HerrHase 3 months ago
parent 7b837b90f1
commit df87d48069

@ -11,12 +11,26 @@ module.exports = tinyComponentsWebpack({
})
```
## Options
### destination
```
const tinyComponentsWebpack = require('@tiny-components/webpack')
module.exports = tinyComponentsWebpack({
<files>
}, {
destination: path.resolve(process.cwd(), '../../')
})
```
### svg
Path to svgs to bundle them with "svg-spritemap-webpack-plugin" to get a
single file,
```
module.exports = tinyComponentsWebpack({
critical: [ './resources/js/critical.js' ],
styles: [ './resources/scss/styles.scss' ],
<files>
}, {
svg: {
src: [
@ -26,12 +40,67 @@ module.exports = tinyComponentsWebpack({
})
```
### context
Working Directory for Webpack,
```
module.exports = tinyComponentsWebpack({
<files>
}, {
context: path.resolve(process.cwd(), '../')
})
```
### publicPath
Name of the Public Path, default is set to '/',
```
module.exports = tinyComponentsWebpack({
<files>
}, {
publicPath: '/public/'
})
```
### purge:src
Directory for find css-classes in files,
```
module.exports = tinyComponentsWebpack({
<files>
}, {
purge: {
src: path.join(__dirname, 'resources/js')
}
})
```
### purge:src
Lists of Regex to ignore css-classes,
```
module.exports = tinyComponentsWebpack({
<files>
}, {
purge: {
safelist: {
deep: [ /tiny-datepicker/, /toast/ ]
}
}
})
```
## Plugin: Riot.js
For using Riot.js, install compiler and webpack-loader
```
npm install @riotjs/compiler @riotjs/webpack-loader --save-dev
bun add @riotjs/compiler @riotjs/webpack-loader --dev
```
And adding a rule for Riot.js,

@ -28,7 +28,7 @@ module.exports = function tinyComponentsWebpack(files, options = {}) {
}
}, options)
const config = {
const config = {
context: defaults.context,
entry: files,
output: {

Loading…
Cancel
Save