diff --git a/.travis.yml b/.travis.yml index 17c7bc4..58dc582 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,9 @@ language: node_js +cache: npm + node_js: - node -cache: - directories: - - node_modules + script: - - yarn test --coverage --coverageReporters=text-lcov | coveralls + - yarn test --coverage --coverageReporters=text-lcov + - codecov diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js index c145a8c..6e10a20 100644 --- a/build/webpack.base.conf.js +++ b/build/webpack.base.conf.js @@ -1,6 +1,5 @@ const path = require('path'); const webpack = require('webpack'); -const chokidar = require('chokidar'); const VueLoaderPlugin = require('vue-loader').VueLoaderPlugin; const MiniCssExtractPlugin = require('mini-css-extract-plugin'); @@ -8,7 +7,9 @@ const env = process.env.NODE_ENV === 'production' ? 'production' : 'development'; -const extractOrInjectStyles = process.env.NODE_ENV !== 'production' +const devtool = env === 'production' ? 'source-map' : 'eval-source-map'; + +const extractOrInjectStyles = env !== 'production' ? 'vue-style-loader' : MiniCssExtractPlugin.loader; @@ -19,7 +20,7 @@ module.exports = { publicPath: '/', filename: '[name].js', }, - // devtool: env === 'production' ? 'source-map' : 'eval-source-map', + devtool, resolve: { extensions: ['.js', '.vue'], alias: { @@ -47,13 +48,10 @@ module.exports = { use: [ extractOrInjectStyles, 'css-loader', + 'postcss-loader', 'sass-loader', ], }, - { - test: /\.html$/, - loader: 'vue-html-loader', - }, ], }, plugins: [ @@ -65,17 +63,8 @@ module.exports = { }), new VueLoaderPlugin(), ], - devServer: { - hot: true, - hotOnly: true, - inline: true, - port: 8080, - before (app, server) { - chokidar.watch([ - './**/*.html', - ]).on('all', function () { - server.sockWrite(server.sockets, 'content-changed'); - }); - }, + stats: { + children: false, + modules: false, }, }; diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js index 437a6d6..9c0d519 100644 --- a/build/webpack.dev.conf.js +++ b/build/webpack.dev.conf.js @@ -1,12 +1,15 @@ const merge = require('webpack-merge'); +const chokidar = require('chokidar'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const baseWebpackConfig = require('./webpack.base.conf'); +/** + * + */ module.exports = merge(baseWebpackConfig, { entry: './dev/dev.js', plugins: [ new HtmlWebpackPlugin({ - filename: 'index.html', template: './dev/dev.html', inject: true, }), @@ -14,4 +17,23 @@ module.exports = merge(baseWebpackConfig, { optimization: { noEmitOnErrors: true, }, + devServer: { + hot: true, + hotOnly: true, + open: true, + inline: true, + stats: { + children: false, + modules: false, + chunks: false, + }, + port: 8080, + before (app, server) { + chokidar.watch([ + './**/*.html', + ]).on('all', function () { + server.sockWrite(server.sockets, 'content-changed'); + }); + }, + }, }); diff --git a/dev/Dev.vue b/dev/Dev.vue index 8db82ff..62735dc 100644 --- a/dev/Dev.vue +++ b/dev/Dev.vue @@ -1,130 +1,35 @@