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

It can't work with vue-cli/webpack-template #2

Open
phcoliveira opened this issue Apr 19, 2018 · 2 comments
Open

It can't work with vue-cli/webpack-template #2

phcoliveira opened this issue Apr 19, 2018 · 2 comments

Comments

@phcoliveira
Copy link

phcoliveira commented Apr 19, 2018

Hello there, I was really needing something this.

Using vue inspect, I can be fairly certain that the first rule is the vue-loader. So I have tried this:

  configureWebpack: config => {
    config.module.rules.splice(1, 0, {
      test: /\.vue$/,
      loader: "vue-themed-style-loader",
      options: {
        theme: "zendesk",
      }
    });
  }

I also did other attempts, like using module.rules.push, but neither worked.
What am I missing?

@marvin-bitterlich
Copy link

@phcoliveira try this:

module.exports = {
  chainWebpack: config => {
    config.module
      .rule('vue')
      .use('vue-loader')
      .loader('vue-loader')
      .tap(options => {
        return options
      });
    config.module
      .rule('vue')
      .use('vue-themed-style-loader')
      .loader('vue-themed-style-loader')
      .tap(options => {
        return { ...options, theme: 'zendesk' }
      });
  }
}

@brophdawg11
Copy link
Owner

Thanks for the suggestion @reggaemuffin. Did that work for you @phcoliveira?

I haven't used this through vue-cli, only in custom webpack builds, so I'm not super familiar with the chainWebpack configuration approach. If you are still having issues - could you provide a CodeSandbox link demonstrating the issue?

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

3 participants