Webpack combining order issues
See original GitHub issue- Laravel Mix Version: 0.8.1
- Node Version: v6.5.0
- NPM Version: 3.10.3
- OS: Windows 10
Description:
I seem to be have some strange issues with the compile order of my requires and imports in app.scss and app.js.
They look like this: app.scss
// Variables
@import "variables";
// Imports
@import "~bootstrap-sass/assets/stylesheets/bootstrap";
@import "~admin-lte/dist/css/AdminLTE.css";
@import "~admin-lte/dist/css/skins/_all-skins.css";
@import "~font-awesome/scss/font-awesome.scss";
@import "~jquery-form-validator/src/theme-default.css";
@import "~simplemde/dist/simplemde.min.css";
// Custom
@import "custom";
app.js
require('./bootstrap.js');
require('admin-lte/dist/js/app.js');
require('jquery-form-validator/form-validator/jquery.form-validator.js');
require('jquery-form-validator/form-validator/security.js');`
Webpack looks like this:
mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css')
.sourceMaps();`
However, the order of the combined files are not how they are required or imported. For example, the AdminLTE styles is loaded in before the Bootstrap styles. Last inserted is Fontawesome, second to last is Bootstrap styles. In the middle of it all I have my Custom, which is imported lastly in the app.scss - hard to make custom changes, if they aren’t combined in the right order.
So what is wrong? Do webpack combine them in a specific order? Gulp did combine in the order of imports and requires.
Steps To Reproduce:
- Install fresh laravel
- Import NPM components as described above
- Insert them in app.js and app.scss
- Run npm run dev
- Check browser for the ordering.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:21
Top Results From Across the Web
Webpack combining order issues · Issue #429 · laravel-mix ...
I seem to be have some strange issues with the compile order of my requires and imports in app.scss and app.js. ... However,...
Read more >Webpack 2 is not compiling files in the right order
In the js file that uses Bootstrap. I ran into this issue when using another js library that depended on jQuery, which I...
Read more >Code Splitting - webpack
This feature allows you to split your code into various bundles which can then be loaded on demand or in parallel. It can...
Read more >Build Performance - webpack
This guide contains some useful tips for improving build/compilation performance. General. The following best practices should help, whether you're running ...
Read more >Entry Points - webpack
... reused and combined with other partial configurations. This is a popular technique used to separate concerns by environment, build target, and runtime....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is still an issue which makes Laravel Mix unusable… Has anyone find a fix?
Node Version: v8.9.4 NPM Version: 5.6.0 OS: Ubuntu 16.04
Please update this!