Last active
March 12, 2019 23:26
-
-
Save matrunchyk/9faccda5f24a86ee3dbc6c4337951030 to your computer and use it in GitHub Desktop.
Working example of `vue.config.js` for vue-cli-3 with electron-plugin support (https://github.com/nklayman/vue-cli-plugin-electron-builder), GraphQL and Stylus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
function resolve(dir) { | |
return path.join(__dirname, dir); | |
} | |
module.exports = { | |
pluginOptions: { | |
graphqlMock: true, | |
apolloEngine: true, | |
electronBuilder: { | |
webpackConfig: { | |
module: { | |
rules: [ | |
{ | |
test: /\.styl(us)?$/, | |
oneOf: [ | |
{ | |
resourceQuery: /module/, | |
use: [ | |
{ | |
loader: 'vue-style-loader', | |
options: { | |
sourceMap: false, | |
shadowMode: false, | |
}, | |
}, | |
{ | |
loader: 'css-loader', | |
options: { | |
minimize: false, | |
sourceMap: false, | |
importLoaders: 2, | |
modules: true, | |
localIdentName: '[name]_[local]_[hash:base64:5]', | |
}, | |
}, | |
{ | |
loader: 'postcss-loader', | |
options: { | |
sourceMap: false, | |
}, | |
}, | |
{ | |
loader: 'stylus-loader', | |
options: { | |
sourceMap: false, | |
preferPathResolver: 'webpack', | |
}, | |
}, | |
], | |
}, | |
{ | |
use: [ | |
{ | |
loader: 'vue-style-loader', | |
options: { | |
sourceMap: false, | |
shadowMode: false, | |
}, | |
}, | |
{ | |
loader: 'css-loader', | |
options: { | |
minimize: false, | |
sourceMap: false, | |
importLoaders: 2, | |
}, | |
}, | |
{ | |
loader: 'postcss-loader', | |
options: { | |
sourceMap: false, | |
}, | |
}, | |
{ | |
loader: 'stylus-loader', | |
options: { | |
sourceMap: false, | |
preferPathResolver: 'webpack', | |
}, | |
}, | |
], | |
}, | |
], | |
}, | |
{ | |
test: /\.(graphql|gql)$/, | |
exclude: /node_modules/, | |
loader: 'graphql-tag/loader', | |
}, | |
], | |
}, | |
}, | |
}, | |
}, | |
configureWebpack: { | |
resolve: { | |
alias: { | |
Common: resolve('src/components/common'), | |
Pages: resolve('src/components/pages'), | |
Components: resolve('src/components'), | |
Charts: resolve('src/components/charts'), | |
Lib: resolve('src/lib'), | |
Router: resolve('src/router'), | |
Store: resolve('src/store'), | |
StoreModules: resolve('src/store/modules'), | |
GQ: resolve('src/GraphQL'), | |
Mixins: resolve('src/mixins'), | |
}, | |
}, | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment