Skip to content

Commit

Permalink
Beltrw mods (#9)
Browse files Browse the repository at this point in the history
* babel should keep code comments. (fix vuejs-templates#730) (vuejs-templates#753)

They are necessary for webpacks "magic comments" to work, e.g. with `import(/* webpackChunkName: "chunk1" */ './component.vue')`

* build: Configure targets.browser for babel-preset-env (vuejs-templates#763)

* Remove inconsistent spacing (vuejs-templates#754)

* feat(gitignore): include common editor directories (vuejs-templates#774)

* feat(gitignore): include common editor directories

add common editor files and directories to .gitignore

closes vuejs-templates#772

* feat(gitignore): remove .vscode directory

remove .vscode directory from .gitignore

* Video audio loader (vuejs-templates#765)

* gitignore vscode

* media loader

audio and video tag

* Remove vscode gitignore

* Add \n back

* fix missing closing bracket

* add default values (img, image)

* Upgrade vue-router to v2.6.0 (vuejs-templates#777)

* Fix console error (vuejs-templates#784)

Fix console error`Failed to load resource: net::ERR_INCOMPLETE_CHUNKED_ENCODING`

* Fix proxy example (fix vuejs-templates#780)

the glob pattern was too narrow, woudl not catch subpaths.

* Fix autoprefixer explanation (vuejs-templates#798)

The parameter to set in package.json is named "browserslist".

* chore: Bump dev dependencies for template (vuejs-templates#790)

* fix: Use false to disable webpack-hot-middleware log (vuejs-templates#778)

* Move Chat: Gitter -> Discord (vuejs-templates#869)

* Remove unnecessary space and comma (vuejs-templates#866)

* load webpack.prod.conf when NODE_ENV=production (vuejs-templates#864)

* Return exit code 1 when npm run build fails (vuejs-templates#854)

* fix standard eslint config link (vuejs-templates#834)

* fix ci build faild (vuejs-templates#857)

* Removing Vue.config.debug usage from documentation (vuejs-templates#871)

* Removing Vue.config.debug usage from documentation

It has been removed; https://vuejs.org/v2/guide/migration.html#Vue-config-debug-removed

* Update env.md

* fixed vue-router dependency(need vue-loader@^13.0.0) (vuejs-templates#876)

* bump vue & vue-router dependencies

* Specify the address to listen on (vuejs-templates#759)

Currently, this causes the dev server to listen on all addresses by default, which is not the intended behavior, imo.

* add HashedModuleIdsPlugin when build (vuejs-templates#870)

* Add support for linked modules (vuejs-templates#688)

* chore(package): rm unused lolex dependency(dev) (vuejs-templates#803)

* fix vuejs-templates#877

* Revert vuejs-templates#688, fix vuejs-templates#879

We have to investigate how we can get vuejs-templates#688 work without the error reported in vuejs-templates#879

* revert: vuejs-templates#759

That's actually not a good idea when you e.g. want to access the dev server from your mobile.

* - Re-added check for router
- Modified eslint file to use standard and have M be a global
  • Loading branch information
rwb7041 authored and JasonGrubb committed Aug 30, 2017
1 parent 22fd0d5 commit f1b859d
Show file tree
Hide file tree
Showing 21 changed files with 108 additions and 39 deletions.
8 changes: 7 additions & 1 deletion circle.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
machine:
node:
version: 6
version: stable

dependencies:
pre:
- sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list'
- sudo apt-get update
- sudo apt-get install google-chrome-stable

test:
override:
Expand Down
10 changes: 5 additions & 5 deletions docs/env.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ So, the environment variables are:

As we can see, `test.env` inherits the `dev.env` and the `dev.env` inherits the `prod.env`.

### Usage
### Usage

It is simple to use the environment variables in your code. For example:
It is simple to use the environment variables in your code. For example:

```js
Vue.config.debug = process.env.DEBUG_MODE
```
```js
Vue.config.productionTip = process.env.NODE_ENV === 'production'
```
2 changes: 1 addition & 1 deletion docs/proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ In addition to static urls you can also use glob patterns to match URLs, e.g. `/

``` js
proxyTable: {
'*': {
'**': {
target: 'http://jsonplaceholder.typicode.com',
filter: function (pathname, req) {
return pathname.match('^/api') && req.method === 'GET'
Expand Down
7 changes: 6 additions & 1 deletion meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ module.exports = {
"type": "string",
"message": "Author"
},
"router": {
"type": "confirm",
"message": "Install vue-router?"
},
"unit": {
"type": "confirm",
"message": "Setup unit tests with Karma + Mocha?"
Expand All @@ -37,7 +41,8 @@ module.exports = {
"config/test.env.js": "unit || e2e",
"test/unit/**/*": "unit",
"build/webpack.test.conf.js": "unit",
"test/e2e/**/*": "e2e"
"test/e2e/**/*": "e2e",
"src/router/**/*": "router"
},
"completeMessage": "To get started:\n\n {{^inPlace}}cd {{destDirName}}\n {{/inPlace}}npm install\n npm run dev\n\nDocumentation can be found at https://github.com/JasonGrubb/webpack"

Expand Down
10 changes: 7 additions & 3 deletions template/.babelrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
{
"presets": [
["env", { "modules": false }],
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"plugins": ["transform-runtime"],
"comments": false,
"env": {
"test": {
"presets": ["env", "stage-2"],
"plugins": [ "istanbul" ]
"plugins": ["istanbul"]
}
}
}
7 changes: 4 additions & 3 deletions template/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ module.exports = {
'_' : true,
'utils': true,
'opts' : true,
'vue' : true
'vue' : true,
'M' : true
},
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
extends: 'vue',
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
extends: 'standard',
// required to lint *.vue files
plugins: [
'html'
Expand Down
7 changes: 7 additions & 0 deletions template/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ test/unit/coverage
test/e2e/reports
selenium-debug.log
{{/e2e}}

# Editor directories and files
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
2 changes: 1 addition & 1 deletion template/.postcssrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module.exports = {
"plugins": {
// to edit target browsers: use "browserlist" field in package.json
// to edit target browsers: use "browserslist" field in package.json
"autoprefixer": {}
}
}
5 changes: 5 additions & 0 deletions template/build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
chunkModules: false
}) + '\n\n')

if (stats.hasErrors()) {
console.log(chalk.red(' Build failed with errors.\n'))
process.exit(1)
}

console.log(chalk.cyan(' Build complete.\n'))
console.log(chalk.yellow(
' Tip: built files are meant to be served over an HTTP server.\n' +
Expand Down
5 changes: 5 additions & 0 deletions template/build/build_preprod.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ rm(path.join(config.build_preprod.assetsRoot, config.build_preprod.assetsSubDire
chunkModules: false
}) + '\n\n')

if (stats.hasErrors()) {
console.log(chalk.red(' Build failed with errors.\n'))
process.exit(1)
}

console.log(chalk.cyan(' Build complete.\n'))
console.log(chalk.yellow(
' Tip: built files are meant to be served over an HTTP server.\n' +
Expand Down
2 changes: 1 addition & 1 deletion template/build/check-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var versionRequirements = [
name: 'node',
currentVersion: semver.clean(process.version),
versionRequirement: packageConfig.engines.node
},
}
]

if (shell.which('npm')) {
Expand Down
5 changes: 3 additions & 2 deletions template/build/dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var path = require('path')
var express = require('express')
var webpack = require('webpack')
var proxyMiddleware = require('http-proxy-middleware')
var webpackConfig = {{#if_or unit e2e}}process.env.NODE_ENV === 'testing'
var webpackConfig = {{#if_or unit e2e}}(process.env.NODE_ENV === 'testing' || process.env.NODE_ENV === 'production')
? require('./webpack.prod.conf')
: {{/if_or}}require('./webpack.dev.conf')
Expand All @@ -31,7 +31,8 @@ var devMiddleware = require('webpack-dev-middleware')(compiler, {
})
var hotMiddleware = require('webpack-hot-middleware')(compiler, {
log: () => {}
log: false,
heartbeat: 2000
})
// force page reload when html-webpack-plugin template changes
compiler.plugin('compilation', function (compilation) {
Expand Down
8 changes: 7 additions & 1 deletion template/build/vue-loader.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,11 @@ module.exports = {
? config.build.productionSourceMap
: config.dev.cssSourceMap,
extract: isProduction
})
}),
transformToRequire: {
video: 'src',
source: 'src',
img: 'src',
image: 'xlink:href'
}
}
12 changes: 11 additions & 1 deletion template/build/webpack.base.conf.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var path = require('path')
var fs = require('fs')
var utils = require('./utils')
var config = require('../config')
var vueLoaderConfig = require('./vue-loader.conf')
Expand All @@ -23,7 +24,8 @@ module.exports = {
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
}
},
symlinks: false
},
module: {
rules: [
Expand Down Expand Up @@ -54,6 +56,14 @@ module.exports = {
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
{
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('media/[name].[hash:7].[ext]')
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
Expand Down
2 changes: 2 additions & 0 deletions template/build/webpack.preprod.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ var webpackConfig = merge(baseWebpackConfig, {
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'dependency'
}),
// keep module.id stable when vender modules does not change
new webpack.HashedModuleIdsPlugin(),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
Expand Down
2 changes: 2 additions & 0 deletions template/build/webpack.prod.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ var webpackConfig = merge(baseWebpackConfig, {
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'dependency'
}),
// keep module.id stable when vender modules does not change
new webpack.HashedModuleIdsPlugin(),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
Expand Down
2 changes: 1 addition & 1 deletion template/build/webpack.test.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var webpackConfig = merge(baseConfig, {
devtool: '#inline-source-map',
resolveLoader: {
alias: {
// necessary to to make lang="scss" work in test when using vue-loader's ?inject option
// 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'
}
Expand Down
32 changes: 16 additions & 16 deletions template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,32 @@
},
"dependencies": {
"axios": "^0.15.3",
"buefy": "^0.3.1",
"bulma": "^0.4.1",
"buefy": "^0.5.1",
"bulma": "^0.5.1",
"font-awesome": "^4.7.0",
"moment": "^2.18.1",
"vue": "^2.3.3",
"vue-router": "^2.3.1",
"vuex": "^2.2.1"
"vue": "^2.4.2",
{{#router}}"vue-router": "^2.7.0",{{/router}}
"vuex": "^2.4.0"
},
"devDependencies": {
"autoprefixer": "^6.7.2",
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-eslint": "^7.1.1",
"babel-loader": "^6.2.10",
"babel-loader": "^7.1.1",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
"babel-register": "^6.22.0",
"chalk": "^1.1.3",
"chalk": "^2.0.1",
"connect-history-api-fallback": "^1.3.0",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.0",
"cssnano": "^3.10.0",
"eslint": "^3.19.0",
"eslint-friendly-formatter": "^2.0.7",
"eslint-friendly-formatter": "^3.0.0",
"eslint-loader": "^1.7.1",
"eslint-plugin-html": "^2.0.0",
"eslint-plugin-html": "^3.0.0",
"eslint-config-standard": "^6.2.1",
"eslint-plugin-promise": "^3.4.0",
"eslint-plugin-standard": "^2.0.1",
Expand All @@ -55,17 +56,16 @@
"http-proxy-middleware": "^0.17.3",
"webpack-bundle-analyzer": "^2.2.1",
{{#unit}}
"cross-env": "^4.0.0",
"cross-env": "^5.0.1",
"karma": "^1.4.1",
"karma-coverage": "^1.1.1",
"karma-mocha": "^1.3.0",
"karma-phantomjs-launcher": "^1.0.2",
"karma-phantomjs-shim": "^1.4.0",
"karma-sinon-chai": "^1.3.1",
"karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "0.0.30",
"karma-spec-reporter": "0.0.31",
"karma-webpack": "^2.0.2",
"lolex": "^1.5.2",
"mocha": "^3.2.0",
"chai": "^3.5.0",
"sinon": "^2.1.0",
Expand All @@ -82,12 +82,12 @@
{{/e2e}}
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"opn": "^4.0.2",
"optimize-css-assets-webpack-plugin": "^1.3.0",
"opn": "^5.1.0",
"optimize-css-assets-webpack-plugin": "^2.0.0",
"ora": "^1.2.0",
"rimraf": "^2.6.0",
"url-loader": "^0.5.8",
"vue-loader": "^12.1.0",
"vue-loader": "^13.0.4",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.3.3",
"webpack": "^2.6.1",
Expand Down
13 changes: 12 additions & 1 deletion template/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
<template>
<div id="app">
<img src="./assets/logo.png">
{{#router}}
<router-view></router-view>
{{else}}
<component></component>
{{/router}}
</div>
</template>

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

Expand Down
2 changes: 1 addition & 1 deletion template/src/components/Component.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ul>
<li><a href="https://vuejs.org" target="_blank">Core Docs</a></li>
<li><a href="https://forum.vuejs.org" target="_blank">Forum</a></li>
<li><a href="https://gitter.im/vuejs/vue" target="_blank">Gitter Chat</a></li>
<li><a href="https://chat.vuejs.org" target="_blank">Community Chat</a></li>
<li><a href="https://twitter.com/vuejs" target="_blank">Twitter</a></li>
<br>
<li><a href="http://vuejs-templates.github.io/webpack/" target="_blank">Docs for This Template</a></li>
Expand Down
4 changes: 4 additions & 0 deletions template/src/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import Vue from 'vue'
import App from './App'
{{#router}}
import router from './router'
{{/router}}
import store from './store/store'
import Buefy from 'buefy'
import moment from 'moment'
Expand All @@ -23,7 +25,9 @@ Vue.use(Buefy, {
/* eslint-disable no-new */
new Vue({
el : '#app',
{{#router}}
router,
{{/router}}
store,
template : '<App/>',
components: { App }
Expand Down

0 comments on commit f1b859d

Please sign in to comment.