Skip to content

Commit

Permalink
Adding some resilience to the compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
benmanu committed Nov 3, 2018
1 parent 5805122 commit a257828
Show file tree
Hide file tree
Showing 6 changed files with 1,365 additions and 85 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module.exports = {
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-param-reassign': 'off',
},
parserOptions: {
parser: 'babel-eslint',
Expand Down
4 changes: 3 additions & 1 deletion app/client/src/store/content/mutations.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import types from '@/store/content/types';

export default {
[types.SET_CONTENT](state, { content }) {
state.content = content;
Object.assign(state, {
content,
});
},
};
8 changes: 6 additions & 2 deletions app/client/src/store/mutations.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ import types from '@/store/types';

export default {
[types.OPEN_MAIN_NAV](state) {
state.isMainNavOpen = true;
Object.assign(state, {
isMainNavOpen: true,
});
},
[types.CLOSE_MAIN_NAV](state) {
state.isMainNavOpen = false;
Object.assign(state, {
isMainNavOpen: false,
});
},
};
2 changes: 1 addition & 1 deletion app/templates/Page.ss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
<link rel="icon" href="/resources/app/client/dist/favicon.ico">
<link rel="icon" href="/resources/app/client/dist/assets/favicon.ico">
<% include HeadScripts %>
</head>
<body>
Expand Down
32 changes: 22 additions & 10 deletions vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
*/
/* eslint-disable-next-line */
const HTMLWebpackPlugin = require('html-webpack-plugin');
/* eslint-disable-next-line */
const CopyWebpackPlugin = require('copy-webpack-plugin');
const path = require('path');
const lessConfig = require('./less.config');

Expand All @@ -27,8 +29,9 @@ module.exports = {
/**
* Modify the `@` alias root.
*/
/* eslint-disable-next-line */
config.resolve.alias['@'] = path.resolve(__dirname, 'app/client/src');
Object.assign(config.resolve.alias, {
'@': path.resolve(__dirname, 'app/client/src'),
});

/**
* add header output
Expand All @@ -49,17 +52,26 @@ module.exports = {
template: 'app/client/html/body.html',
chunks: ['chunk-vendors', 'chunk-common', 'vendor', 'common', 'index'],
}));

/**
* add assets copy
*/
config.plugins.push(new CopyWebpackPlugin([
{
from: path.resolve(__dirname, 'app/client/assets'),
to: path.resolve(__dirname, 'app/client/dist/assets'),
toType: 'dir',
},
]));
},
chainWebpack: (config) => {
/**
* Modify the copy directory from `public` to `app/client/assets`.
* disable index generation and copy plugins.
* we have these custom defined above.
*/
config
.plugin('copy')
.tap((args) => {
/* eslint-disable-next-line */
args[0][0].from = path.resolve(__dirname, 'app/client/assets');
return args;
});
config.plugins.delete('html');
config.plugins.delete('preload');
config.plugins.delete('prefetch');
config.plugins.delete('copy');
},
};
Loading

0 comments on commit a257828

Please sign in to comment.