Skip to content

Instantly share code, notes, and snippets.

@dschniepp
Last active July 23, 2018 07:34
Show Gist options
  • Save dschniepp/9bd92bceab3fc64ee3489e4e77bbf018 to your computer and use it in GitHub Desktop.
Save dschniepp/9bd92bceab3fc64ee3489e4e77bbf018 to your computer and use it in GitHub Desktop.
Boostraping Boostrap 4 with laravel mix
window.Popper = require('popper.js').default;
try {
window.$ = window.jQuery = require('jquery');
require('bootstrap');
} catch (e) {}
@import "../../node_modules/bootstrap/scss/bootstrap";
{
"/assets/js/main.js": "/assets/js/main.js",
"/assets/css/main.css": "/assets/css/main.css"
}
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"axios": "^0.18",
"bootstrap": "^4.0.0",
"popper.js": "^1.12",
"cross-env": "^5.1",
"jquery": "^3.2",
"laravel-mix": "^2.0",
"lodash": "^4.17.4",
"vue": "^2.5.7"
}
}
let mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix.js('assets/js/bootstrap.js', 'assets/js/main.js')
.sass('assets/sass/custom.scss', 'assets/css/main.css');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment