Comments (6)
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.
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.
Nevermind, it works great :)
Thanks for the plugin btw!
from vue-cli-plugin-electron-builder.
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.
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.
Resolved by changing vue.config.js.
@nklayman Thank you for your package, it works well!
from vue-cli-plugin-electron-builder.
Related Issues (20)
- V3 HOT 1
- robotjs failed to package using electron-builder?
- Unable to import preload.js HOT 2
- Unable to Launch Electron App in Development Environment on Specific Computer
- What project to use with Vite? HOT 1
- Unable to build my vue-cli app using vue-cli-plugin-electron-builder 2.1.1
- Any plans to release stable version of vue-cli-plugin-electron-builder 3.0 in near future?
- Unable to modify Heap memory limit
- Can I ask a question,when I use the utilityProcess.fork in main process,what is the param modulePath?Thanks
- Missmatch of dependencies versions between NPM and github HOT 2
- Error: write EPIPE when killElectron
- Why is navigator.bluetooth undefined after packaging? HOT 1
- electron-builder build and install, run with error Cannot read property '_android' of undefined HOT 3
- V-bind() in CSS no longer works when upgrading Electron version
- ERROR: You are using an outdated version of NPM. HOT 1
- Cannot import and use mqtt.js in main process HOT 1
- Socket.io is not working after packing to exe
- Electron does not launch on Raspberry Pi 64-bit (arm64)
- Do not compress the mainBundle during packaging
- Question: How to build a utility process?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-cli-plugin-electron-builder.