Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
laravel-mix-manifest-paths
Advanced tools
A laravel-mix extension that grants access to the generated manifest's paths in static assets.
A laravel-mix extension that grants access to the generated manifest's paths in static assets.
Via npm
npm i -D laravel-mix-manifest-paths
Via yarn
yarn add -D laravel-mix-manifest-paths
// webpack.mix.js
const mix = require("laravel-mix");
require("laravel-mix-manifest-paths");
mix.setPublicPath("public");
mix.version();
mix.js("src/app.js", "public/js")
.sass("src/app.scss", "public/css")
.manifestPaths("src/txt/**", "public/txt");
Now, after the compilation has finished, files matching the glob src/txt/**
will be compiled
as lodash templates and a mix
function will be available to them.
The mix
function works somewhat the same way as the laravel's helper. So this:
blablabla {{mix('/js/app.js')}}
should be html-escaped {{ mix("/js/<special>.js") }}
should not be html-escaped {{! mix("/js/<special>.js") !}}
will be compiled to this (Of course, your hashes will be different):
blablabla /js/app.js?id=752e64981810d0203520
should be html-escaped /js/<special>.js?id=68b329da9893e34099c7
should not be html-escaped /js/<special>.js?id=68b329da9893e34099c7
All options are ... optional, and they're merged with the default options object.
delimiters
{object}
:
left
{string}
: The left delimiter tag. Default is "{{"
right
{string}
: The right delimiter tag. Default is "}}"
flatten
{boolean}
: If true flatten all destination paths,
else preserve the structure of the extracted common parent directory (extracted using glob-parent).
Default is true
.
mix.manifestPaths(from: string | string[], to: string, options?: Options);
from
: A glob or array of globs that matches source files to compile.to
: The output directory.options
: An object to override default options. This parameter is optional.A method is also exposed so you can change the extension's default options:
setDefaultOptions(options: Options);
And can be used like so:
const {setDefaultOptions} = require("laravel-mix-manifest-paths");
setDefaultOptions({
delimiters: {
left: "<<",
right: ">>",
},
});
Be aware that calling this function changes the default options only for subsequent calls to mix.manifestPaths
.
After cloning this repo, ensure dependencies are installed by running:
npm install
And to build the final bundle:
npm run build
To run tests:
npm test
Coverage report is located in tests/coverage
.
Linting is supported by eslint and typescript-eslint.
To run code through the linting script:
npm run lint
And to fix any fixable errors
npm run lint:fix
Please follow the conventional commits specification, because semantic-release is used to automate the whole package release workflow including:
FAQs
A laravel-mix extension that grants access to the generated manifest's paths in static assets.
We found that laravel-mix-manifest-paths demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.