Skip to content

Commit 6ed3b97

Browse files
authored
Merge pull request #146 from laravel/fix-bootstrap-preset
[2.x] Fix Bootstrap preset
2 parents 2ccaa3b + efb2e89 commit 6ed3b97

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

Diff for: src/Presets/Bootstrap.php

+13
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class Bootstrap extends Preset
1414
public static function install()
1515
{
1616
static::updatePackages();
17+
static::updateWebpackConfiguration();
1718
static::updateSass();
1819
static::updateBootstrapping();
1920
static::removeNodeModules();
@@ -31,9 +32,21 @@ protected static function updatePackageArray(array $packages)
3132
'bootstrap' => '^4.0.0',
3233
'jquery' => '^3.2',
3334
'popper.js' => '^1.12',
35+
'sass' => '^1.15.2',
36+
'sass-loader' => '^8.0.0',
3437
] + $packages;
3538
}
3639

40+
/**
41+
* Update the Webpack configuration.
42+
*
43+
* @return void
44+
*/
45+
protected static function updateWebpackConfiguration()
46+
{
47+
copy(__DIR__.'/bootstrap-stubs/webpack.mix.js', base_path('webpack.mix.js'));
48+
}
49+
3750
/**
3851
* Update the Sass files for the application.
3952
*

Diff for: src/Presets/bootstrap-stubs/webpack.mix.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const mix = require('laravel-mix');
2+
3+
/*
4+
|--------------------------------------------------------------------------
5+
| Mix Asset Management
6+
|--------------------------------------------------------------------------
7+
|
8+
| Mix provides a clean, fluent API for defining some Webpack build steps
9+
| for your Laravel application. By default, we are compiling the Sass
10+
| file for the application as well as bundling up all the JS files.
11+
|
12+
*/
13+
14+
mix.js('resources/js/app.js', 'public/js')
15+
.sass('resources/sass/app.scss', 'public/css');

0 commit comments

Comments
 (0)