Skip to content

Commit

Permalink
Added vue-router, unit tests and fixed a few issues. Changed main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitkrai03 committed Aug 16, 2017
1 parent 3505539 commit 9592b48
Show file tree
Hide file tree
Showing 15 changed files with 1,825 additions and 49 deletions.
9 changes: 1 addition & 8 deletions template/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,12 @@ module.exports = {
'settings': {
'import/resolver': {
'webpack': {
'config': 'webpack.config.js'
'config': 'build/webpack.base.js'
}
}
},
// add your custom rules here
'rules': {
"no-underscore-dangle": [
0
],
"new-cap": [
0
],
"semi": [2, "always"],
// don't require .vue extension when importing
'import/extensions': ['error', 'always', {
'js': 'never',
Expand Down
2 changes: 1 addition & 1 deletion template/build/webpack.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const defaults = {
};

const webpackConfig = {
entry: './src/index.js',
entry: './src/js/main.js',
output: {
path: config.assetsRoot,
publicPath: config.assetsPublicPath,
Expand Down
39 changes: 39 additions & 0 deletions template/build/webpack.testing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// This is the webpack config used for unit tests.

const webpack = require("webpack");
const merge = require("webpack-merge");
const baseConfig = require("./webpack.base");

const webpackConfig = merge(baseConfig, {
// use inline sourcemap for karma-sourcemap-loader
module: {
rules: [
{
test: /\.scss$/,
loaders: ['style-loader', 'css-loader', 'sass-loader'],
},
{
test: /\.css$/,
loaders: ['style-loader', 'css-loader'],
},
],
},
devtool: "#inline-source-map",
resolveLoader: {
alias: {
// necessary to to make lang="scss" work in test when using vue-loader's ?inject option
// see discussion at https://github.com/vuejs/vue-loader/issues/724
"scss-loader": "sass-loader"
}
},
plugins: [
new webpack.DefinePlugin({
"process.env.NODE_ENV": '"testing"'
})
]
});

// no need for app entry during tests
delete webpackConfig.entry;

module.exports = webpackConfig;
Loading

0 comments on commit 9592b48

Please sign in to comment.