Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global plugin config doesn't work #424

Closed
terion-name opened this issue Feb 19, 2017 · 2 comments
Closed

global plugin config doesn't work #424

terion-name opened this issue Feb 19, 2017 · 2 comments

Comments

@terion-name
Copy link
Contributor

I need to process and build multiple style-files. I want to set default plugin options.
As far I understand, this should be done like this:

mix.config.css = {
  stylus: {
    paths: ['node_modules', 'resources/assets/stylus'],
    'include css': true,
    'resolve url': true
  }
};

But this has no effect. This works:

const stylusOptons = {
  paths: ['node_modules', 'resources/assets/stylus'],
  'include css': true,
  'resolve url': true
};

mix.setPublicPath('./public/assets');

mix.stylus('resources/assets/stylus/home.styl', 'css', stylusOptons);

mix
    .stylus('resources/assets/stylus/vote/main.styl', 'css/vote', stylusOptons)
    .stylus('resources/assets/stylus/vote/alter.styl', 'css/vote', stylusOptons)
    .stylus('resources/assets/stylus/vote/order.styl', 'css/vote', stylusOptons)
    .stylus('resources/assets/stylus/vote/open.styl', 'css/vote', stylusOptons);

but this is not good

@JeffreyWay
Copy link
Collaborator

JeffreyWay commented Feb 19, 2017

Most people will only call mix.stylus() once. But if you need to call it multiple times, you can pass the stylusOptions options like your example shows. Alternatively, you can copy the webpack.config.js file that we provide, and set the defaults however you want.

@terion-name
Copy link
Contributor Author

@JeffreyWay so there is no way to add global config without altering plugin settings without editing webpack.config.js? And no plans for it? This really makes sense not only for multiple files to compile, but also if this would affect vue's components preprocessed styles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants