This package allows the creation of symbolic links (files and folders) during the laravel-mix bundling.
The parameters to the function paths accept both windows & unix-style paths, relative and absolute paths as well as UNC network paths.
- Install the package with npm or yarn:
npm install laravel-mix-symbolic-links --save-dev
yarn add laravel-mix-symbolic-links --dev
- Require the extension in your Mix configuration:
const mix = require('laravel-mix');
require('laravel-mix-symbolic-links');
- Create symbolic link folders using the createSymbolicFolder method
mix.createSymbolicFolder(path, target)
mix.createSymbolicFolder("dist/data", "src/data")
mix.createSymbolicFolder("dist/data", "//mnt/d/testdata")
mix.createSymbolicFolder("dist/data", "c:/windows/temp")
- Create symbolic link files using the createSymbolicFile method
mix.createSymbolicFolder(path, target)
mix.createSymbolicFolder("dist/data/data.json", "src/data/data.json")
mix.createSymbolicFolder("dist/data/data.json", "//mnt/d/testdata/data.json")
mix.createSymbolicFolder("dist/data/data.json", "c:/windows/temp/data.json")