Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
laravel-bundler
Advanced tools
Modern asset building tool for Laravel framework with better defaults.
Modern asset building tool for Laravel framework with better defaults.
:warning: This package does not work with laravel-mix
; you must remove laravel-mix
before using this one
# yarn
yarn add laravel-bundler
# npm
npm install laravel-bundler
Create a resources/js/app.js
file like
// Import libraries
import 'vue';
import { BootstrapVue } from 'bootstrap-vue'
// You can import styles like this
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
// Write your own code
Vue.use(BootstrapVue);
new Vue({
'el': '#app'
})
Create a webpack.config.js
file on your project root and remove webpack.mix.js
if exists.
const webpack = require('webpack');
const ReloadOnBladeChange = require('laravel-bundler/src/plugins/ReloadOnBladeChange.js');
module.exports = require('laravel-bundler')({
entry: {
app: './resources/js/app.js',
},
plugins: [
new ReloadOnBladeChange()
],
// Other webpack configs may go here
},
require('laravel-bundler/src/recipes/vue-2.js')
);
Update your package.json
file
"scripts": {
"dev": "webpack --progress --mode=development",
"watch": "npm run dev -- --watch",
"prod": "webpack --mode=production",
"hot": "webpack serve --progress --hot"
},
"browserslist": [
"> 2%",
"not dead"
]
Update your blade template
<!-- header -->
<link href="{{ mix('css/app.css') }}" rel="stylesheet">
<!-- footer -->
<script src="{{ mix('js/manifest.js') }}"></script>
<script src="{{ mix('js/vendor.js') }}"></script>
<script src="{{ mix('js/app.js') }}"></script>
Update your .gitignore
file
/public/hot
/public/js
/public/css
/public/fonts
/public/images
/public/mix-manifest.json
@babel/preset-env
CSS
and SASS|SCSS
supportautoprefixer
and cssnano
mix-manifest.json
compatible with Laravel's mix()
helper.env
file that are prefixed with MIX_
:wink:These features are not in the plan but can be enabled on demand :man_shrugging:
sass|scss
MIT License
FAQs
Modern and fast asset building tool for Laravel framework with better defaults.
The npm package laravel-bundler receives a total of 175 weekly downloads. As such, laravel-bundler popularity was classified as not popular.
We found that laravel-bundler demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.