diff --git a/build/build.js b/build/build.js index ae6605b..263db51 100644 --- a/build/build.js +++ b/build/build.js @@ -3,13 +3,7 @@ const config = require('./webpack.prod.conf'); webpack(config, (err, stats) => { if (err || stats.hasErrors()) { - // 在这里处理错误 - console.error(err); + console.error(err); // 错误打印 return; } - // 处理完成 - console.log(stats.toString({ - chunks: false, // 使构建过程更静默无输出 - colors: true // 在控制台展示颜色 - })); -}); +}); \ No newline at end of file diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js index d869e94..30eda9a 100644 --- a/build/webpack.base.conf.js +++ b/build/webpack.base.conf.js @@ -1,25 +1,20 @@ const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); -const AutoDllPlugin = require('autodll-webpack-plugin'); const VueLoaderPlugin = require('vue-loader/lib/plugin'); module.exports = { - entry: { - bundle: path.resolve(__dirname, '../src/index.js') - }, - output: { - path: path.resolve(__dirname, '../dist'), - filename: '[name].[hash].js' - }, - resolve: { - extensions: ['*', '.js', '.json', '.vue'], - alias: { - 'vue$': 'vue/dist/vue.esm.js', - '@': path.resolve(__dirname, '../src'), - } - }, - module: { - rules: [ + entry: { + bundle: path.resolve(__dirname, '../src/index.js') + }, + output: { + path: path.resolve(__dirname, '../dist'), + filename: '[name].[hash].js' + }, + resolve: { + extensions: ['*', '.js', '.json', '.vue'], + }, + module: { + rules: [ { test: /\.vue$/, loader: 'vue-loader' @@ -29,27 +24,12 @@ module.exports = { use: 'babel-loader', exclude: /node_modules/ }, - { - test: /\.css$/, - use: ['vue-style-loader', 'css-loader'] - } - ] - }, - plugins: [ - new HtmlWebpackPlugin({ - template: path.resolve(__dirname, '../index.html') - }), - // Dll 优化,需要的时候可以打开 - // new AutoDllPlugin({ - // inject: true, // will inject the DLL bundle to index.html - // debug: true, - // filename: '[name]_[hash].js', - // path: './dll', - // entry: { - // vendor: ['vue', 'vue-router'] - // } - // }), + ] + }, + plugins: [ + new HtmlWebpackPlugin({ + template: path.resolve(__dirname, '../index.html') + }), new VueLoaderPlugin(), - // new webpack.optimize.SplitChunksPlugin() - ] -}; + ] +}; \ No newline at end of file diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js index c6e7b71..785f401 100644 --- a/build/webpack.dev.conf.js +++ b/build/webpack.dev.conf.js @@ -6,15 +6,12 @@ module.exports = merge(baseConfig, { mode: "development", devtool: "inline-source-map", module: { - rules: [ // 自己拓展着玩呀 - // { - // test: /\.css$/, - // use: ["vue-style-loader", "css-loader", "postcss-loader"], - // }, + rules: [ // 自己拓展着玩呀 + ], }, devServer: { contentBase: path.resolve(__dirname, "../dist"), open: true, }, -}); +}); \ No newline at end of file diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js index 5045ba3..07c3ca2 100644 --- a/build/webpack.prod.conf.js +++ b/build/webpack.prod.conf.js @@ -8,13 +8,7 @@ module.exports = merge(baseConfig, { devtool: "source-map", module: { rules: [ // 自己拓展着玩呀 - // { - // test: /\.css$/, - // use: [ - // 'css-loader', - // 'postcss-loader', - // ] - // }, + ], }, plugins: [ @@ -24,4 +18,4 @@ module.exports = merge(baseConfig, { dry: false, }), ], -}); +}); \ No newline at end of file