Repository navigation
Conversation
Codecov Report
@@ Coverage Diff @@
## master #109 +/- ##
==========================================
- Coverage 95.1% 94.37% -0.73%
==========================================
Files 8 8
Lines 245 249 +4
Branches 84 85 +1
==========================================
+ Hits 233 235 +2
- Misses 12 14 +2
Continue to review full report at Codecov.
|
|
The Logging out the bundle gives me the following: Test bundle (modules > extract){
code: '\'use strict\';\n\nvar css = {shouldBeOverridden:bar_shouldBeOverridden};\n\nvar second = {shouldOverride:style_shouldOverride};\n\nconsole.log(first, css.shouldBeOverridden);\nconsole.log(second, second.shouldOverride);\n',
map: undefined
}Actual use bundle (minimal example){
imports: [],
exports: [],
modules:
[ '/extract-css-source-order/src/some-component/styles.css',
'/extract-css-source-order/src/some-component/index.js',
'/extract-css-source-order/src/styles.css',
'/extract-css-source-order/src/index.js' ],
code: 'const css = {};\n\nconst element = document.createElement(div);\nconst text = document.createTextNode(This should be green);\nelement.appendChild(text);\nelement.classList.add(css.shouldBeOverriden);\n\nconst css = {};\n\nconst element = element;\nelement.classList.add(css.shouldOverride);\n\ndocument.getElementById(root).appendChild(element);\n',
map: null } |
|
Any thoughts on the above @egoist? :) |
|
Would really appreciate some help here @egoist 🙂 |
|
Thanks for digging into this @dnjstrom! I am having the same problem. I have a single file where all of my style imports are imported and the order of the imports do not seem to affect the compiled output. Import order in index.jsimport './vendor/quasar/dist/quasar.mat.css'
import 'quasar-extras/roboto-font'
import 'vue-datetime/dist/vue-datetime.min.css'
import './styl/styles.styl'
import './scss/styles.scss'Compiled output orderstyles.styl
styles.scss
quasar.mat.css
vue-datetime.min.css
roboto-font.css |
|
/ping @egoist |
|
ping @egoist |
|
BUMP @egoist maybe its time someone forks this and republishes |
|
It looks like this may have been fixed in rollup. |
|
I can confirm, upgrading to the latest version of rollup fixes this for me, even with the mainline release of rollup-plugin-postcss. |
|
@GreenGremlin: I'm afraid that issue is different from what this PR aims to address. The issue you linked deals with the execution order of different successive plugins, while this pr is only concerned with the generated style order produced by I've updated my minimal example project with the latest |
|
Fixed in another PR, thanks everyone. |
Heavily guided by the reference-implementation by danburzo in #96 these changes correct the source ordering of the extracted styles in the minimal example from #108 and my original project.