This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

laravel-mix-ext

1.7.2 • Public • Published

The Extension of Laravel Mix

The Laravel Mix provides a clean, fluent API for defining basic webpack build steps for your web application. The Laravel Mix supports several common CSS and JavaScript preprocessors.

The Extension of Laravel Mix adds and modifies methods and presets to Laravel Mix. Its use is recommended for those developments which are stand-alone (not Laravel) projects.

npm version npm license npm downloads

Table of contents

Compatibility

With operating systems

v1.4.4 – v1.7.2
  • Linux
  • macOS
  • Windows
v0.8.0 – v1.4.2
  • Linux
  • macOS

With Laravel Mix versions

v1.5.0 – v1.7.2

1.5.1 ≤ Laravel Mix version < 1.8.0

v1.4.0 – v1.4.5

1.4.2 ≤ Laravel Mix version < 1.5.0

v0.8.0 – v0.8.13

0.8.8 ≤ Laravel Mix version < 0.9.0

Installation

Requirements:

Create project directory and enter into:

mkdir my-web-application
cd my-web-application

Create and set package.json file:

npm init

Install The Extension of Laravel Mix:

npm install laravel-mix-ext --save-dev

and set up:

node node_modules/laravel-mix-ext/setup

To surely overwrite any previous settings (for example reinstall), use the force argument (-f):

node node_modules/laravel-mix-ext/setup -f

Then specify the project's custom settings in the webpack.mix.js file.

An example application (Hello, World!) can also be installed with original settings:

node node_modules/laravel-mix-ext/example

The force argument (-f) can be used in this case too:

node node_modules/laravel-mix-ext/example -f

Run the project in dev, watch, hot or production mode:

npm run watch

Hello, World!

Go for it! Start the development…

Release notes

v1.7.2

Modifies the readme, no other change.

v1.7.0

Modifies the Laravel Mix version dependency.

v1.6.4

Adds package dependencies and informations.

v1.6.0

Modifies the Laravel Mix version dependency.

v1.5.8

Fixes the watching of the template files.

v1.5.7

Fixes the watching of the template files.

Adds a timestamp to the logging of the template processing.

v1.5.6

Adds the logging of the template processing and a native notification that the template processing is done.

Updates the development dependency.

v1.5.5

Modifies the template processing and its setting.

v1.5.4

No change.

v1.5.3

Adds an image to the example.

Modifies the cross-env package version dependency.

v1.5.2

Fixes the template processing setting.

v1.5.1

Fixes the template processing setting.

v1.5.0

Modifies the Laravel Mix version dependency and rewrites the output configuration management in accordance with the new Laravel Mix options (fileLoaderDirs).

Modifies the setup (scripts-to-package.json) according to the new recommendation.

v1.4.5

Modifies the Laravel Mix version dependency.

v1.4.4

Adds Windows operating system support. Previous versions are only compatible with POSIX operating systems (Linux, macOS, etc.).

v1.4.2

Adds the browser-sync and the browser-sync-webpack-plugin packages to dependencies.

Improves the setPublicPath() method.

v1.4.1

Modifies the original mix.setPublicPath() method: If the public directory does not exist yet, it will create it.

v1.4.0

The code is rewrited to use the current version of Laravel Mix.

v0.8.13

Adds an example application (Hello, World!) and the description of its installation.

v0.8.12

Extends the Laravel Mix with .out() method for the setting of output directories (images and fonts).

Giving the difference from the default is enough. For example:

mix
    .out({
        images: {
            directory: 'img',
            extensions: ['svg']
        },
        fonts: 'font'
    })
;

or:

mix
    .out({
        images: ['svg']
    })
;

The default settings:

{
    images: {
        directory: 'images',
        extensions: ['png', 'jpe?g', 'gif']
    },
    fonts: {
        directory: 'fonts',
        extensions: ['woff2?', 'ttf', 'eot', 'svg', 'otf']
    }
}

The setup code is refactored and documented.

v0.8.11

Fixes the modified mix.browserSync() method: restores chaining.

The code is refactored and documented.

v0.8.10

Adds the setup file (setup/index.js) and the description of installation.

v0.8.9

Adds the auto setting of contentBase and the auto opening in browser to the configuration options of webpack dev server in the example webpack.config.js file.

Adds the scripts-to-package.json file to the setup examples.

v0.8.8

Sets the default configuration to mix.browserSync() method according to the specified public path.

v0.8.6

Adds the watching of template files change to the setting of npm run hot call too. In the case of npm run hot call, the versioning is not turned on.

v0.8.4

Adds the watching of template files change to the setting of npm run watch call. In the case of npm run watch call, if the template file(s) change, than the output file(s) are also updated.

v0.8.2

The processing of template files is rewritten.

v0.8.0

Extends the Laravel Mix with the .tpl() template manager method, sets the npm run watch call and automates the versioning.

The mix.tpl(src, target) method has two mandatory parameters. The src parameter is the source template file and the target parameter is the output file. The .tpl() method copies the src file to the target and replaces the {{ mix('file-path') }} code snippets to the path of the referenced files in the copy file. The replacement is based on the manifest.json file, so you can only refer to files that are included in the manifest.json file.

Multiple template files can be processed as follows:

mix
    .tpl(src1, target1)
    .tpl(src2, target2)
;

When calling npm run watch, if the referenced files change, than the target file(s) are also updated.

Automatically turns on the versioning (except npm run hot call).

Its use is recommended for those developments which are stand-alone (not Laravel) projects.

License

The MIT License (MIT)
Copyright © 2017–2018 Haász Sándor, http://haasz-sandor.hu

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package Sidebar

Install

npm i laravel-mix-ext

Weekly Downloads

0

Version

1.7.2

License

MIT

Unpacked Size

499 kB

Total Files

19

Last publish

Collaborators

  • haasz