Git Product home page Git Product logo

Comments (6)

nklayman avatar nklayman commented on July 22, 2024

You need to modify the webpack config and add loaders for graphql/stylus. See here for more details.

Your vue.config.js should look something like this:

module.exports = {
  pluginOptions: {
    electronBuilder: {
      webpackConfig: {
        module: {
          rules: [
            {
              test: /\.styl$/,
              use: [
                { loader: "style-loader" },
                { loader: "css-loader" },
                { loader: "stylus-loader" }
              ]
            },
            {
              test: /\.(graphql|gql)$/,
              exclude: /node_modules/,
              loader: 'graphql-tag/loader',
            },
          ]
        },
        resolve: {
          extensions: [".vue", ".js", ".styl"]
        }
      }
    }
  }
};

Also make sure to add stylus, stylus-loader, and graphql-tag.

from vue-cli-plugin-electron-builder.

matrunchyk avatar matrunchyk commented on July 22, 2024

Thanks, but why we have to duplicate the same what already been done by vue-cli? That's one of the key functionalities of vue-cli 3 when a user doesn't have to manually define webpack config.

I think the plugin should give an opportunity to extend/inherit existing configs form vue.config.js, what do you think?

from vue-cli-plugin-electron-builder.

matrunchyk avatar matrunchyk commented on July 22, 2024

Nevermind, it works great :)
Thanks for the plugin btw!

from vue-cli-plugin-electron-builder.

matrunchyk avatar matrunchyk commented on July 22, 2024

Ahh, no, stylus loader doesn't work. It works great in Chrome, but not in Electron... So it seems like the plugin doesn't include the configuration from vue-cli-service.

from vue-cli-plugin-electron-builder.

nklayman avatar nklayman commented on July 22, 2024

I have tried to use the existing config with api.resolveWebpackConfig(), however, I get a slew of errors. So, unfortunately, I don't think this is possible. For now, you will have to write the electron webpack config by yourself.

I tried the stylus config myself and it worked fine, so I'm not sure why it didn't work for you. Can you attach your yarn/npm error log after you run build/serve:electron so I can see what went wrong. Also attach your vue.config.js. Thanks.

from vue-cli-plugin-electron-builder.

matrunchyk avatar matrunchyk commented on July 22, 2024

Resolved by changing vue.config.js.

@nklayman Thank you for your package, it works well!

from vue-cli-plugin-electron-builder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.