You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Go to file
HerrHase 0e3461afa1
bugfix for emit in manifest, add check parameter for svg
3 months ago
plugins bugfix for emit in manifest, add check parameter for svg 3 months ago
rules adding #1 #3 3 months ago
.gitignore Initial commit 9 months ago
LICENSE adding 9 months ago
README.md update 3 months ago
index.js bugfix for emit in manifest, add check parameter for svg 3 months ago
manifest.js bugfix for emit in manifest, add check parameter for svg 3 months ago
package.json bugfix for emit in manifest, add check parameter for svg 3 months ago

README.md

Webpack

Small Wrapper Function for using Webpack. These Function is only Build to using,

const tinyComponentsWebpack = require('@tiny-components/webpack')

module.exports = tinyComponentsWebpack({
    critical: [ './resources/js/index.js' ],
    styles: [ './resources/scss/styles.scss' ],
})

Options

destination

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({
    <files>
}, {
    svg: {
        src: [ 
            './resources/icons/*.svg'
        ]
    }
})

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,

const tinyComponentsWebpack = require('@tiny-components/webpack')
const riotPlugin = require('@tiny-components/webpack/rules/riot')

module.exports = tinyComponentsWebpack({
    critical: [ './resources/js/critical.js' ], 
    styles: [ './resources/scss/styles.scss' ],
}, {
    rules: [ riotRules ]
})