Skip to content

Commit c01eb54

Browse files
committed
updates
1 parent 463bdb2 commit c01eb54

File tree

10 files changed

+28
-54
lines changed

10 files changed

+28
-54
lines changed

template/build/build.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var webpackConfig = require('./webpack.prod.conf')
1111
var spinner = ora('building for production...')
1212
spinner.start()
1313

14-
var assetsPath = path.join(config.build.assetsRoot, config.build.assetsPrefix)
14+
var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory)
1515
rm('-rf', assetsPath)
1616
mkdir('-p', assetsPath)
1717
cp('-R', 'static/', assetsPath)

template/build/dev-server.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ app.use(devMiddleware)
5151
app.use(hotMiddleware)
5252

5353
// serve pure static assets
54-
var staticPath = path.join(config.build.assetsPublicPath, config.build.assetsPrefix)
54+
var staticPath = path.join(config.build.assetsPublicPath, config.build.assetsSubDirectory)
5555
app.use(staticPath, express.static('./static'))
5656

5757
module.exports = app.listen(port, function (err) {

template/build/webpack.base.conf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ module.exports = {
6161
loader: 'url',
6262
query: {
6363
limit: 10000,
64-
name: path.join(config.build.assetsPrefix, '[name].[ext]?[hash:7]')
64+
name: path.join(config.build.assetsSubDirectory, '[name].[ext]?[hash:7]')
6565
}
6666
}
6767
]

template/build/webpack.prod.conf.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ module.exports = merge(baseWebpackConfig, {
1111
devtool: config.build.productionSourceMap ? '#source-map' : false,
1212
output: {
1313
path: config.build.assetsRoot,
14-
filename: path.join(config.build.assetsPrefix, '[name].[chunkhash].js'),
15-
chunkFilename: path.join(config.build.assetsPrefix, '[id].[chunkhash].js')
14+
filename: path.join(config.build.assetsSubDirectory, '[name].[chunkhash].js'),
15+
chunkFilename: path.join(config.build.assetsSubDirectory, '[id].[chunkhash].js')
1616
},
1717
vue: {
1818
loaders: cssLoaders({
@@ -34,7 +34,7 @@ module.exports = merge(baseWebpackConfig, {
3434
}),
3535
new webpack.optimize.OccurenceOrderPlugin(),
3636
// extract css into its own file
37-
new ExtractTextPlugin(path.join(config.build.assetsPrefix, '[name].[contenthash].css')),
37+
new ExtractTextPlugin(path.join(config.build.assetsSubDirectory, '[name].[contenthash].css')),
3838
// generate dist index.html with correct asset hash for caching.
3939
// you can customize output by editing /index.html
4040
// see https://github.com/ampedandwired/html-webpack-plugin

template/config.js

+2-38
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,14 @@ var path = require('path')
22

33
module.exports = {
44
build: {
5-
// Where the index.html will be generated. Must be an absolute path.
6-
// The generated file will have correct asset URLs auto-injected.
7-
// If you are using this template with a backend-framework, you can set this
8-
// to the backend view file (.php, .erb etc.) rendered for your app.
95
index: path.resolve(__dirname, 'dist/index.html'),
10-
11-
// The root directory for your app's static assets. Must be an absolute path.
12-
// If you are using this template with a backend-framework, set this to
13-
// the framework's static assets directory, e.g. /path/to/project/public.
146
assetsRoot: path.resolve(__dirname, 'dist'),
15-
16-
// Nest webpack-generated assets under this directory in `assetsRoot`, so
17-
// that they are not mixed with other files you may have in `assetsRoot`.
18-
//
19-
// Files inside /static will be copied into this directory as-is. This means
20-
// if you change this prefix, all your absolute URLs referencing files in
21-
// /static will also need to be changed.
22-
//
23-
// This directory will be cleaned before each build.
24-
assetsPrefix: 'static',
25-
26-
// This is where your `assetsRoot` will be served from over HTTP.
27-
// Only change this if your backend framework serves static assets with
28-
// a path prefix.
7+
assetsSubDirectory: 'static',
298
assetsPublicPath: '/',
30-
31-
// Whether to generate source map for production builds
329
productionSourceMap: true
3310
},
34-
3511
dev: {
36-
// Dev server port
3712
port: 8080,
38-
39-
// Proxy requests to different backend during development.
40-
// https://github.com/chimurai/http-proxy-middleware
41-
proxyTable: {
42-
// '/api': {
43-
// target: 'http://jsonplaceholder.typicode.com',
44-
// changeOrigin: true,
45-
// pathRewrite: {
46-
// '^/api': ''
47-
// }
48-
// }
49-
}
13+
proxyTable: {}
5014
}
5115
}

template/src/App.vue

+13-5
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
<img class="logo" src="./assets/logo.png">
44
<hello></hello>
55
<p>
6-
Welcome to your Vue.js app. To get started, take a look at the
7-
<a href="https://github.com/vuejs-templates/webpack#folder-structure" target="_blank">README</a>
8-
of this template. If you have any issues with the setup, please file an issue at this template's repository.
6+
Welcome to your Vue.js app!
97
</p>
108
<p>
11-
For advanced configurations, checkout the docs for
9+
To get a better understanding of how this boilerplate works, check out
10+
<a href="http://vuejs-templates.github.io/webpack" target="_blank">its documentation</a>.
11+
It is also recommended to go through the docs for
1212
<a href="http://webpack.github.io/" target="_blank">Webpack</a> and
1313
<a href="http://vuejs.github.io/vue-loader/" target="_blank">vue-loader</a>.
14+
If you have any issues with the setup, please file an issue at this boilerplate's
15+
<a href="https://github.com/vuejs-templates/webpack" target="_blank">repository</a>.
1416
</p>
1517
<p>
1618
You may also want to checkout
@@ -43,12 +45,18 @@ body {
4345
}
4446
4547
#app {
48+
color: #2c3e50;
4649
margin-top: -100px;
4750
max-width: 600px;
48-
font-family: Helvetica, sans-serif;
51+
font-family: Source Sans Pro, Helvetica, sans-serif;
4952
text-align: center;
5053
}
5154
55+
#app a {
56+
color: #42b983;
57+
text-decoration: none;
58+
}
59+
5260
.logo {
5361
width: 100px;
5462
height: 100px

template/src/components/Hello.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ export default {
2121
<!-- Add "scoped" attribute to limit CSS to this component only -->
2222
<style scoped>
2323
h1 {
24-
color: #4fc08d;
24+
color: #42b983;
2525
}
2626
</style>

template/test/unit/.eslintrc

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
22
"env": {
3-
"jasmine": true
3+
"mocha": true
4+
},
5+
"globals": {
6+
"expect": true,
7+
"sinon": true
48
}
59
}

template/test/unit/karma.conf.js

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ var webpackConfig = merge(baseConfig, {
2222
delete webpackConfig.entry
2323

2424
// make sure isparta loader is applied before eslint
25+
webpackConfig.module.preLoaders = webpackConfig.module.preLoaders || []
2526
webpackConfig.module.preLoaders.unshift({
2627
test: /\.js$/,
2728
loader: 'isparta',

template/test/unit/specs/Hello.spec.js

-3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,3 @@ describe('Hello.vue', () => {
1010
expect(vm.$el.querySelector('.hello h1').textContent).to.contain('Hello World!')
1111
})
1212
})
13-
14-
// also see example testing a component with mocks at
15-
// https://github.com/vuejs/vue-loader-example/blob/master/test/unit/a.spec.js#L24-L49

0 commit comments

Comments
 (0)