Skip to content

Commit

Permalink
fix vue-config.remove unused dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreezag committed Nov 25, 2019
1 parent 3ae67b1 commit 2af97e2
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 77 deletions.
4 changes: 0 additions & 4 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ const EmptyParentComponent = {
}

const demoRoutes = []
if (process.env.NODE_ENV === 'development' || process.env.VUE_APP_INCLUDE_DEMOS) {
const vueBookRoutes = require('./vueBookRoutes').default
vueBookRoutes.forEach(route => demoRoutes.push(route))
}

export default new Router({
mode: process.env.VUE_APP_ROUTER_MODE_HISTORY === 'true' ? 'history' : 'hash',
Expand Down
15 changes: 0 additions & 15 deletions src/router/vueBookRoutes.js

This file was deleted.

100 changes: 42 additions & 58 deletions vue.config.js
Original file line number Diff line number Diff line change
@@ -1,68 +1,52 @@
const path = require('path')
const StylelintPlugin = require('stylelint-webpack-plugin')

let config

if (process.env.VUE_APP_BOOK) {
config = {
lintOnSave: false,
transpileDependencies: ['vuestic-ui'],
pages: {
index: {
entry: 'src/vue-book/book-main.js',
template: 'public/index.html',
},
},
}
}

if (!process.env.VUE_APP_BOOK) {
config = {
lintOnSave: false,
transpileDependencies: ['vuestic-ui'],
pages: {
index: {
// entry for the page
entry: 'src/app/main.js',
// the source template
template: 'public/index.html',
// output as dist/index.html
filename: 'index.html',
// when using title option,
// template title tag needs to be <title><%= htmlWebpackPlugin.options.title %></title>
title: 'Vuestic Admin',
// chunks to include on this page, by default includes
// extracted common chunks and vendor chunks.
chunks: ['chunk-vendors', 'chunk-common', 'index'],
},
module.exports = {
lintOnSave: false,
transpileDependencies: [
'vuestic-ui',
'epic-spinners',
],
pages: {
index: {
// entry for the page
entry: 'src/app/main.js',
// the source template
template: 'public/index.html',
// output as dist/index.html
filename: 'index.html',
// when using title option,
// template title tag needs to be <title><%= htmlWebpackPlugin.options.title %></title>
title: 'Vuestic Admin',
// chunks to include on this page, by default includes
// extracted common chunks and vendor chunks.
chunks: ['chunk-vendors', 'chunk-common', 'index'],
},
configureWebpack: {
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': path.resolve('src'),
},
},
configureWebpack: {
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': path.resolve('src'),
},
plugins: [new StylelintPlugin({
files: ['src/**/*.{vue,htm,html,css,sss,less,scss}'],
})],
},
css: {
loaderOptions: {
sass: {
// Preload vuestic-ui variables and mixins for every component
data: `@import "~vuestic-ui/src/components/vuestic-sass/resources/resources.scss";`,
},
plugins: [new StylelintPlugin({
files: ['src/**/*.{vue,htm,html,css,sss,less,scss}'],
})],
},
css: {
loaderOptions: {
sass: {
// Preload vuestic-ui variables and mixins for every component
data: `@import "~vuestic-ui/src/components/vuestic-sass/resources/resources.scss";`,
},
},
pwa: {
workboxPluginMode: 'InjectManifest',
workboxOptions: {
swSrc: './src/service-worker.js',
importWorkboxFrom: 'local',
},
},
pwa: {
workboxPluginMode: 'InjectManifest',
workboxOptions: {
swSrc: './src/service-worker.js',
importWorkboxFrom: 'local',
},
}
},
}

module.exports = config

0 comments on commit 2af97e2

Please sign in to comment.