mix-version-replace

1.0.2 • Public • Published

Webpack plugin to update laravel-mix version ids on static files.

Useful for SPA frontend development with laravel-mix and without platform layout.

#replacement for laravel mix helper function outside of PHP 
<script src="{{ mix("js/app.js") }}"></script>

# install 
$ npm install  --save-dev mix-version-replace


# Usage 

#in webpack.mix.js

const MixVersionReplace = require('mix-version-replace');

mix.webpackConfig({
    ...
    plugins: [
        new MixVersionReplace({
            files: [
                'public/**/*.html',
                'public/**/*.php'
            ],
            mixManifest: 'public/mix-manifest.json',
        })
    ]
})
 
 
# in webpack.config.js

const MixVersionReplace = require('./lib/mix-version-replace');

module.exports = {
    ...
    plugins: [
        new MixVersionReplace({
            files: [
                'public/**/*.html',
                'public/**/*.php'
            ],
            mixManifest: 'public/mix-manifest.json',
        })
    ]
}

Package Sidebar

Install

npm i mix-version-replace

Weekly Downloads

1

Version

1.0.2

License

ISC

Unpacked Size

4.66 kB

Total Files

3

Last publish

Collaborators

  • estagent