Skip to content
This repository was archived by the owner on Sep 24, 2020. It is now read-only.

Commit 8e507bf

Browse files
committed
Update hot reloading.
* Make hot reloading optional * Minify CSS on build * Implement Bootstrap v4 * Add standard linting for Javascript and Typescript * Update npm packages
1 parent 816adf2 commit 8e507bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+4297
-1606
lines changed

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Change log
22

3+
## [v1.3.0] (2018-01-31)
4+
5+
**Features**
6+
7+
* Minify CSS on build
8+
* Implement Bootstrap v4
9+
* Prompt for hot-reloading on project initialisation
10+
* Add `standard` for Javascript linting
11+
* Add `tslint-config-standard` for Typescript linting
12+
* Uplift npm packages
13+
314
## [v1.2.1] (2018-01-08)
415

516
**Features**
@@ -153,6 +164,7 @@
153164
[#3]: https://github.com/ducksoupdev/vue-webpack-typescript/pull/3
154165
[#2]: https://github.com/ducksoupdev/vue-webpack-typescript/pull/2
155166
[#1]: https://github.com/ducksoupdev/vue-webpack-typescript/pull/1
167+
[v1.3.0]: https://github.com/ducksoupdev/vue-webpack-typescript/compare/v1.2.1...v1.3.0
156168
[v1.2.1]: https://github.com/ducksoupdev/vue-webpack-typescript/compare/v1.2.0...v1.2.1
157169
[v1.2.0]: https://github.com/ducksoupdev/vue-webpack-typescript/compare/v1.1.1...v1.2.0
158170
[v1.1.1]: https://github.com/ducksoupdev/vue-webpack-typescript/compare/v1.1.0...v1.1.1

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# webpack-typescript
22

3-
> A Vue, Webpack and Typescript setup with hot reload, dynamic imports, unit testing,
4-
code coverage, sass and bundling/minification.
3+
> A Vue, Webpack, Typescript, Bootstrap setup with hot reload, dynamic imports, unit testing,
4+
code coverage, sass, uncss and bundling/minification.
55

66
> This template is for Vue 2.5. See the [changelog](CHANGELOG.md) for updates.
77

meta.json

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
"author": {
1515
"type": "string",
1616
"label": "Author"
17+
},
18+
"hotReload": {
19+
"type": "confirm",
20+
"message": "Use hot-reloading?",
21+
"default": true
1722
}
1823
},
1924
"completeMessage": "To get started:\n\n cd {{destDirName}}\n npm install\n npm run dev"

template/config/helpers.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
const path = require('path');
1+
const path = require('path')
22

3-
// Helper functions
4-
const ROOT = path.resolve(__dirname, '..');
3+
const ROOT = path.resolve(__dirname, '..')
54

6-
function root(args) {
7-
args = Array.prototype.slice.call(arguments, 0);
8-
return path.join.apply(path, [ROOT].concat(args));
5+
function root (args) {
6+
args = Array.prototype.slice.call(arguments, 0)
7+
return path.join.apply(path, [ROOT].concat(args))
98
}
109

11-
exports.root = root;
10+
exports.root = root

template/karma.coverage.js template/config/karma.coverage.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
var parseArgs = require('minimist');
2-
var webpackConfig = require('./config/webpack.config.coverage');
1+
var parseArgs = require('minimist')
2+
var webpackConfig = require('./webpack.config.coverage')
33

44
var args = parseArgs(process.argv.slice(2), {
55
string: ['env'],
66
default: {
77
'env': 'mocha'
88
}
9-
});
9+
})
1010

11-
var reporters = ['mocha', 'coverage'];
11+
var reporters = ['mocha', 'coverage']
1212

1313
if (args.env === 'tc') {
14-
reporters = ['teamcity', 'coverage'];
14+
reporters = ['teamcity', 'coverage']
1515
}
1616

1717
if (args.env === 'jk') {
18-
reporters = ['junit', 'coverage'];
18+
reporters = ['junit', 'coverage']
1919
}
2020

2121
module.exports = function (config) {
2222
config.set({
23-
basePath: '',
23+
basePath: '..',
2424
frameworks: ['mocha', 'chai', 'sinon'],
2525
files: [
2626
'node_modules/es6-promise/dist/es6-promise.auto.js',
@@ -54,5 +54,5 @@ module.exports = function (config) {
5454
},
5555
singleRun: true,
5656
concurrency: Infinity
57-
});
58-
};
57+
})
58+
}

template/karma.debug.js template/config/karma.debug.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
var webpackConfig = require('./config/webpack.config.test');
1+
var webpackConfig = require('./webpack.config.test')
22

33
module.exports = function (config) {
44
config.set({
5-
basePath: '',
5+
basePath: '..',
66
frameworks: ['source-map-support', 'mocha', 'chai', 'sinon'],
77
files: [
88
'node_modules/es6-promise/dist/es6-promise.auto.js',
99
{
10-
pattern: "node_modules/es6-promise/dist/es6-promise.auto.map",
10+
pattern: 'node_modules/es6-promise/dist/es6-promise.auto.map',
1111
watched: false,
1212
included: false,
1313
served: true
@@ -29,14 +29,14 @@ module.exports = function (config) {
2929
colors: true,
3030
logLevel: config.LOG_INFO,
3131
autoWatch: true,
32-
browsers: ["Chrome_with_debugging"],
32+
browsers: ['Chrome_with_debugging'],
3333
customLaunchers: {
3434
Chrome_with_debugging: {
35-
base: "Chrome",
36-
flags: ["--remote-debugging-port=9222"],
35+
base: 'Chrome',
36+
flags: ['--remote-debugging-port=9222'],
3737
debug: true
3838
}
3939
},
4040
singleRun: false
41-
});
42-
};
41+
})
42+
}

template/karma.unit.js template/config/karma.unit.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
var webpackConfig = require('./config/webpack.config.test');
1+
var webpackConfig = require('./webpack.config.test')
22

3-
module.exports = function(config) {
3+
module.exports = function (config) {
44
config.set({
5-
basePath: '',
5+
basePath: '..',
66
frameworks: ['mocha', 'chai', 'sinon'],
77
files: [
88
'node_modules/es6-promise/dist/es6-promise.auto.js',
@@ -23,5 +23,5 @@ module.exports = function(config) {
2323
'text/x-typescript': ['ts']
2424
},
2525
singleRun: true
26-
});
27-
};
26+
})
27+
}
+23-23
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
const helpers = require('./helpers'),
2-
NamedModulesPlugin = require('webpack/lib/NamedModulesPlugin'),
3-
CopyWebpackPlugin = require('copy-webpack-plugin');
1+
const helpers = require('./helpers')
2+
const NamedModulesPlugin = require('webpack/lib/NamedModulesPlugin')
3+
const CopyWebpackPlugin = require('copy-webpack-plugin')
44

55
let config = {
66
entry: {
@@ -16,35 +16,35 @@ let config = {
1616
resolve: {
1717
extensions: ['.ts', '.js', '.html'],
1818
alias: {
19-
'vue$': 'vue/dist/vue.esm.js',
19+
'vue$': 'vue/dist/vue.esm.js'
2020
}
2121
},
2222
module: {
2323
rules: [{
24-
test: /\.ts$/,
25-
exclude: /node_modules/,
26-
enforce: 'pre',
27-
loader: 'tslint-loader'
28-
},
29-
{
30-
test: /\.ts$/,
31-
exclude: /node_modules/,
32-
loader: 'awesome-typescript-loader'
33-
},
34-
{
35-
test: /\.html$/,
36-
loader: 'raw-loader',
37-
exclude: ['./src/index.html']
38-
}
39-
],
24+
test: /\.ts$/,
25+
exclude: /node_modules/,
26+
enforce: 'pre',
27+
loader: 'tslint-loader'
28+
},
29+
{
30+
test: /\.ts$/,
31+
exclude: /node_modules/,
32+
loader: 'awesome-typescript-loader'
33+
},
34+
{
35+
test: /\.html$/,
36+
loader: 'raw-loader',
37+
exclude: ['./src/index.html']
38+
}
39+
]
4040
},
4141
plugins: [
4242
new NamedModulesPlugin(),
4343
new CopyWebpackPlugin([{
4444
from: 'src/assets',
4545
to: './assets'
46-
}, ]),
46+
} ])
4747
]
48-
};
48+
}
4949

50-
module.exports = config;
50+
module.exports = config

template/config/webpack.config.coverage.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const webpackConfig = require('./webpack.config.test');
1+
const webpackConfig = require('./webpack.config.test')
22

33
webpackConfig.module.rules = [...webpackConfig.module.rules,
44
{
@@ -13,6 +13,6 @@ webpackConfig.module.rules = [...webpackConfig.module.rules,
1313
esModules: true
1414
}
1515
}
16-
];
16+
]
1717

18-
module.exports = webpackConfig;
18+
module.exports = webpackConfig

template/config/webpack.config.dev.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
const helpers = require('./helpers'),
2-
webpackConfig = require('./webpack.config.base'),
3-
HtmlWebpackPlugin = require('html-webpack-plugin'),
4-
DefinePlugin = require('webpack/lib/DefinePlugin'),
5-
env = require('../environment/dev.env');
1+
const helpers = require('./helpers')
2+
const webpackConfig = require('./webpack.config.base')
3+
const HtmlWebpackPlugin = require('html-webpack-plugin')
4+
const DefinePlugin = require('webpack/lib/DefinePlugin')
5+
const env = require('../environment/dev.env')
66

77
webpackConfig.module.rules = [...webpackConfig.module.rules,
88
{
99
test: /\.scss$/,
1010
use: [{
11-
loader: 'style-loader'
12-
},
13-
{
14-
loader: 'css-loader'
15-
},
16-
{
17-
loader: 'sass-loader'
18-
}
11+
loader: 'style-loader'
12+
},
13+
{
14+
loader: 'css-loader'
15+
},
16+
{
17+
loader: 'sass-loader'
18+
}
1919
]
2020
},
2121
{
2222
test: /\.(jpg|png|gif|eot|svg|ttf|woff|woff2)$/,
2323
loader: 'file-loader'
2424
}
25-
];
25+
]
2626

2727
webpackConfig.plugins = [...webpackConfig.plugins,
2828
new HtmlWebpackPlugin({
@@ -33,7 +33,7 @@ webpackConfig.plugins = [...webpackConfig.plugins,
3333
new DefinePlugin({
3434
'process.env': env
3535
})
36-
];
36+
]
3737

3838
webpackConfig.devServer = {
3939
port: 8080,
@@ -45,6 +45,6 @@ webpackConfig.devServer = {
4545
},
4646
contentBase: './src',
4747
open: true
48-
};
48+
}
4949

50-
module.exports = webpackConfig;
50+
module.exports = webpackConfig

0 commit comments

Comments
 (0)