Skip to content

Commit

Permalink
more conditional rendering options
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitkrai03 committed Aug 17, 2017
1 parent 3aa744b commit 5e5438f
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
2 changes: 2 additions & 0 deletions template/build/webpack.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ const webpackConfig = {
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
{{#if_eq build "standalone"}}
vue$: 'vue/dist/vue.esm.js',
{{/if_eq}}
},
},
plugins: [
Expand Down
4 changes: 4 additions & 0 deletions template/build/webpack.production.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ const CopyWebpackPlugin = require('copy-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin');
{{#lodash}}
const LodashModuleReplacementPlugin = require('lodash-webpack-plugin');
{{/lodash}}

const webpackConfig = {
devtool: '#source-map',
Expand Down Expand Up @@ -41,7 +43,9 @@ const webpackConfig = {
dead_code: true,
},
}),
{{#lodash}}
new LodashModuleReplacementPlugin(),
{{/lodash}}
// extract css into its own file
new ExtractTextPlugin({
filename: './css/[name].[contenthash].css',
Expand Down
6 changes: 3 additions & 3 deletions template/build/webpack.testing.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// This is the webpack config used for unit tests.

const webpack = require("webpack");
const merge = require("webpack-merge");
const baseConfig = require("./webpack.base");
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
Expand Down
13 changes: 13 additions & 0 deletions template/src/js/App.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
<template>
<div id="app">
<img src="../assets/logo.png">
{{#router}}
<router-view></router-view>
{{else}}
<hello></hello>
{{/router}}
</div>
</template>

<script>
{{#unless router}}
import Hello from './components/Hello';
{{/unless}}
export default {
name: 'app',
{{#router}}
{{else}},
components: {
Hello,
},
{{/router}}
};
</script>

Expand Down
2 changes: 1 addition & 1 deletion template/src/js/components/Hello.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<h1>\{{ msg }}</h1>
<h2>Essential Links</h2>
<ul>
<li><a href="https://vuejs.org" target="_blank">Core Docs</a></li>
Expand Down

0 comments on commit 5e5438f

Please sign in to comment.