Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beltrw mods #9

Merged
merged 29 commits into from
Aug 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8563cdb
babel should keep code comments. (fix #730) (#753)
LinusBorg Jun 22, 2017
065f24c
build: Configure targets.browser for babel-preset-env (#763)
sudo-suhas Jun 27, 2017
703c29e
Remove inconsistent spacing (#754)
scottbedard Jun 27, 2017
19ea95c
feat(gitignore): include common editor directories (#774)
eddyerburgh Jun 28, 2017
9992f5a
Video audio loader (#765)
Ffloriel Jul 13, 2017
d7c572d
Upgrade vue-router to v2.6.0 (#777)
katranci Jul 13, 2017
5f4d89f
Fix console error (#784)
shaodahong Jul 13, 2017
10524e4
Fix proxy example (fix #780)
LinusBorg Jul 14, 2017
0e75e9e
Fix autoprefixer explanation (#798)
aspectis Jul 15, 2017
db40d7f
chore: Bump dev dependencies for template (#790)
sudo-suhas Jul 15, 2017
e1f781e
fix: Use false to disable webpack-hot-middleware log (#778)
sudo-suhas Aug 1, 2017
92aa34b
Move Chat: Gitter -> Discord (#869)
swapagarwal Aug 27, 2017
2654005
Remove unnecessary space and comma (#866)
akifo Aug 27, 2017
d8a9340
load webpack.prod.conf when NODE_ENV=production (#864)
helaili Aug 27, 2017
a34532a
Return exit code 1 when npm run build fails (#854)
pksunkara Aug 27, 2017
9d6e72a
fix standard eslint config link (#834)
afontcu Aug 27, 2017
ebee3dc
fix ci build faild (#857)
gucong3000 Aug 27, 2017
1b4b988
Removing Vue.config.debug usage from documentation (#871)
adam-lynch Aug 28, 2017
b0f6240
fixed vue-router dependency(need vue-loader@^13.0.0) (#876)
kakahikari Aug 28, 2017
0afaaf6
bump vue & vue-router dependencies
LinusBorg Aug 28, 2017
079e92e
Specify the address to listen on (#759)
Aug 28, 2017
0880d9b
add HashedModuleIdsPlugin when build (#870)
awamwang Aug 28, 2017
7c1e230
Add support for linked modules (#688)
adambiggs Aug 28, 2017
1ec2928
chore(package): rm unused lolex dependency(dev) (#803)
sudo-suhas Aug 28, 2017
eaccc50
fix #877
LinusBorg Aug 28, 2017
0866970
Revert #688, fix #879
LinusBorg Aug 29, 2017
a56d4c6
revert: #759
LinusBorg Aug 29, 2017
29418e0
- Re-added check for router
rwb7041 Aug 30, 2017
10075f2
- Merged with changes from vuejs-templates/webpack
rwb7041 Aug 30, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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