File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,14 @@ that's included on every page:
1515
1616 // this creates a 'vendor.js' file with jquery and the bootstrap JS module
1717 // these modules will *not* be included in page1.js or page2.js anymore
18- .createSharedEntry (' vendor' , [' jquery' , ' bootstrap' ])
18+ .createSharedEntry (' vendor' , [
19+ ' jquery' ,
20+ ' bootstrap' ,
21+
22+ // you can also extract CSS - this will create a 'vendor.css' file
23+ // this CSS will *not* be included in page1.css or page2.css anymore
24+ ' bootstrap-sass/assets/stylesheets/_bootstrap.scss'
25+ ])
1926
2027 As soon as you make this change, you need to include two extra JavaScript files
2128on your page before any other JavaScript file:
@@ -29,6 +36,9 @@ on your page before any other JavaScript file:
2936 <!-- here you link to the specific JS files needed by the current page -->
3037 <script src="{{ asset('build/app.js') }}"></script>
3138
39+ <!-- if you extracted some CSS, include vendor.css -->
40+ <link rel="stylesheet" href="{{ asset('build/vendor.css') }}" />
41+
3242 The ``vendor.js `` file contains all the common code that has been extracted from
3343the other files, so it's obvious that it must be included. The other file (``manifest.js ``)
3444is less obvious: it's needed so that Webpack knows how to load those shared modules.
You can’t perform that action at this time.
0 commit comments