Open chiboreache opened 5 years ago
I also tried nuxt-stylus-resources-loader
resolve = require('path').resolve
['nuxt-stylus-resources-loader', resolve(__dirname, 'assets/**/*.styl')]
with almost the same result, error message now is a little bit more verbose
at WebpackBundler.webpackCompile (node_modules/@nuxt/webpack/dist/webpack.js:5262:15)
at processTicksAndRejections (internal/process/next_tick.js:81:5)
@chiboreache Hey :wave:
Please provide a reproduction repo.
Dynamic asset imports should work like shown in https://github.com/nuxt-community/style-resources-module/blob/master/test/fixture/sass/nuxt.config.js#L11 (pre-processor-independent)
@manniL hello again :hand:
Nice link, but I'm using stylus ;)
so example file says
styleResources: {
stylus: ['~assets/variables.styl']
},
I can't provide anything, I just have mixins and styl file with classes, which are I want to reuse by importing in pages via `@import '~assets/someClasses' or globally, as I mentioned above
Global import not work, meanwhile simple importing works in dev and causing an error during the building time
Just right after the message: additional chunk assets processing (91%)
Try @/assets
as prefix.
I can't provide anything, I just have mixins and styl file with classes, which are I want to reuse by importing in pages via `@import '~assets/someClasses' or globally, as I mentioned above
Then you can reproduce it by putting them in a codesandbox so I can play around with the project ;)
Just loaded my mega neat setup into CS, and apparently @import
does not provide any errors... Maybe something with my local webpack, but I'll investigate that tomorrow, I'm going to sleep, finally :crescent_moon:
furthermore, I realised some undocumented logic
css: ['~assets/onlyForStyling.styl'],
styleResources: {
stylus: ['~assets/everythingElse.styl'] or even
stylus: ['~assets/*.styl'] but not without css object
},
So it works, sort of
but not like that css: ['~assets/styl.styl', '~assets/mixins.styl'],
or that css: ['~assets/*.styl'],
So yeah, have fun heh
https://codesandbox.io/s/o7rppmxmny?fontsize=14&module=%2Fnuxt.config.js index — /assets — config
So, I'm back Here is working example (vuex store stop working for some reason, but whatever)
My conclusion:
css:
.styl
files styleResources:
but I am still get an error for my project 😔
Ironically problem was in just an one string of styl file — transform: rotate3D(0)
what a shame...
but yeah, it would be awesome if compiler in dev mode told me about that earlier >< some one will update the docs `^^`
dry docs is always causing some stupid issues..
Wildcard import — causing error Dot import — simple not working
npx nuxt build → Version: webpack 4.29.6
and so on