Skip to content

Commit c709f9e

Browse files
committed
Merge remote-tracking branch 'origin/develop'
* origin/develop: (42 commits) remove chunk name update supported browsers upgrade to webpack 2 start integration with webpack 2 add styles for input inside toolbar vuematerial#395 rename method remove custom click bindings apply theme-color based on primary theme color remove unnecessary Vue.extend on component definition deprecated click bubble normalize mobile and desktop events on ripple prevent ripple from getting undefined when ripple elements doesnt exists allow preventDefault in md-switch (vuematerial#435) enable swipe to open or close sidenav (vuematerial#429) enable multiple expansions in mdList vuematerial#442 pause snackbar timeout on hover (vuematerial#434) fix position of md-list-action as first child vuematerial#408 force list item to have buttons with type="button" recreate list item fix overflow button color theme in cards ...
2 parents b35485a + 52cc3f1 commit c709f9e

File tree

102 files changed

+2959
-1673
lines changed

Some content is hidden

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

102 files changed

+2959
-1673
lines changed

.babelrc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22
"presets": [
33
"es2015",
44
"es2017",
5-
"stage-0"
5+
"stage-0",
6+
[
7+
"env",
8+
{
9+
"targets": {
10+
"browsers": ["last 3 versions", "not IE < 11"]
11+
}
12+
}
13+
]
614
],
715
"plugins": [
816
"transform-runtime",

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.DS_Store
22
node_modules/
33
npm-debug.log
4+
nbproject

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Vue Material is lightweight framework built exactly according to the <a href="ht
2020

2121
It aims to deliver a collection of reusable components and a series of UI Elements to build applications with support to all modern Web Browsers through Vue 2.
2222

23-
Build powerful and well-designed web apps that can can fit on every screen. You can generate and use themes dynamically, use components on demand, take advantage of UI Elements and Components with an ease-to-use API.
23+
Build powerful and well-designed web apps that can fit on every screen. You can generate and use themes dynamically, use components on demand, take advantage of UI Elements and Components with an ease-to-use API.
2424

2525
## Demo and Documentation
2626
<a href="https://vuematerial.github.io/" target="_blank">Demo</a>

build/server/index.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@ const app = express();
1313
const compiler = webpack(webpackConfig);
1414
const rootPath = path.join(__dirname, '..', '..');
1515
const devMiddlewareInstance = devMiddleware(compiler, {
16+
quiet: true,
1617
publicPath: config.publicPath,
17-
index: config.indexPath,
18-
stats: {
19-
colors: true,
20-
chunks: false
21-
}
18+
index: config.indexPath
2219
});
2320

24-
const hotMiddlewareInstance = hotMiddleware(compiler);
21+
const hotMiddlewareInstance = hotMiddleware(compiler, {
22+
log() { }
23+
});
2524

2625
compiler.plugin('compilation', (compilation) => {
2726
compilation.plugin('html-webpack-plugin-after-emit', (data, done) => {
@@ -36,14 +35,16 @@ app.use(hotMiddlewareInstance);
3635
app.use('/', express.static(path.join(rootPath, config.docsPath)));
3736
app.use('/assets', express.static(path.join(rootPath, config.assetsPath)));
3837

39-
export default app.listen(config.server.port, (error) => {
38+
devMiddlewareInstance.waitUntilValid(() => {
4039
let uri = 'http://localhost:' + config.server.port;
4140

41+
console.log(chalk.blue('> Listening at ' + uri + '\n'));
42+
});
43+
44+
export default app.listen(config.server.port, (error) => {
4245
if (error) {
4346
console.log(chalk.red(error));
4447

4548
return;
4649
}
47-
48-
console.log(chalk.blue('Listening at ' + uri + '\n'));
4950
});

build/webpack/base.js

Lines changed: 28 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import webpack from 'webpack';
33
import eslintFormatter from 'eslint-friendly-formatter';
44
import config from '../config';
55

6+
const resolvePath = (dir) => {
7+
return path.resolve(__dirname, '..', '..', dir);
8+
};
9+
610
export default {
711
entry: {
812
docs: './docs/src/index.js'
@@ -13,81 +17,50 @@ export default {
1317
filename: '[name].js'
1418
},
1519
resolve: {
16-
extensions: ['', '.js', '.vue'],
17-
fallback: [config.nodePath],
20+
extensions: ['.js', '.vue', '.json'],
1821
alias: {
19-
assets: path.resolve(__dirname, '../../docs/src/assets')
22+
assets: resolvePath('docs/src/assets')
2023
}
2124
},
22-
resolveLoader: {
23-
fallback: [config.nodePath]
24-
},
2525
module: {
26-
preLoaders: [
27-
{
28-
test: /\.vue$/,
29-
loader: 'eslint',
30-
include: config.projectRoot,
31-
exclude: /node_modules/
32-
},
26+
rules: [
3327
{
34-
test: /\.js$/,
35-
loader: 'eslint',
36-
include: config.projectRoot,
37-
exclude: /node_modules/
38-
}
39-
],
40-
loaders: [
41-
{
42-
test: /\.vue$/,
43-
loader: 'vue'
28+
test: /\.(js|vue)$/,
29+
loader: 'eslint-loader',
30+
enforce: 'pre',
31+
include: [
32+
resolvePath('build'),
33+
resolvePath('src'),
34+
resolvePath('docs')
35+
],
36+
options: {
37+
fix: true,
38+
formatter: eslintFormatter
39+
}
4440
},
4541
{
4642
test: /\.js$/,
47-
loader: 'babel',
48-
include: config.projectRoot,
49-
exclude: /node_modules/
50-
},
51-
{
52-
test: /\.css$/,
53-
loader: 'vue-style-loader!css-loader'
54-
},
55-
{
56-
test: /\.scss$/,
57-
loader: 'vue-style-loader!css-loader!sass-loader'
43+
loader: 'babel-loader',
44+
include: [
45+
resolvePath('build'),
46+
resolvePath('src'),
47+
resolvePath('docs')
48+
]
5849
},
5950
{
6051
test: /\.theme$/,
61-
loaders: ['raw', 'sass-loader']
62-
},
63-
{
64-
test: /\.json$/,
65-
loaders: ['json-loader']
52+
use: ['raw-loader', 'sass-loader']
6653
},
6754
{
68-
test: /\.(png|jpg|gif|svg)(\?.*)?$/,
69-
loader: 'url',
55+
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
56+
loader: 'url-loader',
7057
query: {
7158
limit: 10000,
7259
name: '/assets/[name].[hash:8].[ext]'
7360
}
74-
},
75-
{
76-
test: /\.html$/,
77-
loader: 'vue-html'
7861
}
7962
]
8063
},
81-
eslint: {
82-
fix: true,
83-
formatter: eslintFormatter
84-
},
85-
vue: {
86-
loaders: {
87-
css: 'vue-style-loader!css-loader',
88-
scss: 'vue-style-loader!css-loader!sass-loader'
89-
}
90-
},
9164
plugins: [
9265
new webpack.DefinePlugin({
9366
'process.env': config.env

build/webpack/debug-lib.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import webpack from 'webpack';
21
import merge from 'webpack-merge';
32
import ExtractTextPlugin from 'extract-text-webpack-plugin';
43
import OptimizeJsPlugin from 'optimize-js-plugin';
@@ -12,11 +11,7 @@ const devConfig = merge(prodConfig, {
1211
});
1312

1413
devConfig.plugins = [
15-
new webpack.optimize.OccurenceOrderPlugin(),
16-
new webpack.optimize.DedupePlugin(),
17-
new OptimizeJsPlugin({
18-
sourceMap: false
19-
}),
14+
new OptimizeJsPlugin(),
2015
new ExtractTextPlugin('[name].css')
2116
];
2217

build/webpack/dev.js

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,47 @@
11
import webpack from 'webpack';
22
import merge from 'webpack-merge';
33
import HtmlWebpackPlugin from 'html-webpack-plugin';
4+
import FriendlyErrorsPlugin from 'friendly-errors-webpack-plugin';
45
import baseWebpackConfig from './base';
56
import config from '../config';
67

78
Object.keys(baseWebpackConfig.entry).forEach((name) => {
8-
baseWebpackConfig.entry[name] = ['./build/server/client'].concat(baseWebpackConfig.entry[name]);
9+
baseWebpackConfig.entry[name] = ['./build/server/client', ...[baseWebpackConfig.entry[name]]];
910
});
1011

1112
export default merge(baseWebpackConfig, {
12-
devtool: 'source-map',
13+
devtool: '#eval-source-map',
14+
module: {
15+
rules: [
16+
{
17+
test: /\.vue$/,
18+
loader: 'vue-loader',
19+
options: {
20+
loaders: {
21+
css: 'vue-style-loader!css-loader',
22+
scss: 'vue-style-loader!css-loader!sass-loader'
23+
}
24+
}
25+
},
26+
{
27+
test: /\.css$/,
28+
use: ['vue-style-loader', 'css-loader']
29+
},
30+
{
31+
test: /\.scss$/,
32+
use: ['vue-style-loader', 'css-loader', 'sass-loader']
33+
}
34+
]
35+
},
1336
plugins: [
1437
new webpack.WatchIgnorePlugin([config.nodePath]),
1538
new webpack.HotModuleReplacementPlugin(),
16-
new webpack.NoErrorsPlugin(),
39+
new webpack.NoEmitOnErrorsPlugin(),
1740
new HtmlWebpackPlugin({
1841
filename: 'index.html',
1942
template: 'docs/index.html',
2043
inject: true
21-
})
44+
}),
45+
new FriendlyErrorsPlugin()
2246
]
2347
});

build/webpack/prod-docs.js

Lines changed: 49 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,65 @@ import baseConfig from './base';
1111

1212
const docsPath = path.join(config.rootPath, config.docsPath);
1313

14-
export default merge(baseConfig, {
14+
const conf = merge(baseConfig, {
1515
output: {
1616
path: docsPath,
1717
publicPath: '',
1818
filename: '[name].[chunkhash:8].js',
1919
chunkFilename: '[name].[chunkhash:8].js'
2020
},
21-
vue: {
22-
loaders: {
23-
css: ExtractTextPlugin.extract('css'),
24-
scss: ExtractTextPlugin.extract('css!sass')
25-
},
26-
postcss: [
27-
autoprefixer({
28-
browsers: ['last 3 versions']
29-
})
21+
module: {
22+
rules: [
23+
{
24+
test: /\.vue$/,
25+
loader: 'vue-loader',
26+
options: {
27+
loaders: {
28+
css: ExtractTextPlugin.extract({
29+
use: 'css-loader',
30+
fallback: 'vue-style-loader'
31+
}),
32+
scss: ExtractTextPlugin.extract({
33+
use: 'css-loader!sass-loader',
34+
fallback: 'vue-style-loader'
35+
})
36+
},
37+
postcss: [
38+
autoprefixer({
39+
browsers: ['last 3 versions', 'not IE < 11']
40+
})
41+
]
42+
}
43+
},
44+
{
45+
test: /\.css$/,
46+
loader: ExtractTextPlugin.extract({
47+
use: 'css-loader',
48+
fallback: 'vue-style-loader'
49+
})
50+
},
51+
{
52+
test: /\.scss$/,
53+
loader: ExtractTextPlugin.extract({
54+
use: 'css-loader!sass-loader',
55+
fallback: 'vue-style-loader'
56+
})
57+
}
3058
]
3159
},
3260
plugins: [
33-
new webpack.optimize.DedupePlugin(),
61+
new webpack.LoaderOptionsPlugin({
62+
minimize: true,
63+
debug: true
64+
}),
3465
new webpack.optimize.UglifyJsPlugin({
3566
compress: {
3667
warnings: false
3768
},
38-
comments: false
69+
output: {
70+
comments: false
71+
},
72+
sourceMap: false
3973
}),
4074
new OptimizeJsPlugin({
4175
sourceMap: false
@@ -96,7 +130,8 @@ export default merge(baseConfig, {
96130
new webpack.optimize.CommonsChunkPlugin({
97131
name: 'manifest',
98132
chunks: ['vendor']
99-
}),
100-
new webpack.optimize.OccurenceOrderPlugin()
133+
})
101134
]
102135
});
136+
137+
export default conf;

0 commit comments

Comments
 (0)