webpack.config.base.js 547 B

1234567891011121314151617181920
  1. const path = require('path');
  2. const HtmlWebpackPlugin = require('html-webpack-plugin');
  3. module.exports = {
  4. entry: {
  5. index: path.join(__dirname, '../src/main.js'),
  6. },
  7. output: {
  8. filename: '[name].bundle.[chunkhash].js',
  9. path: path.resolve(__dirname, '../dist'),
  10. clean: true, // 每一次打包前清空dist文件夹
  11. },
  12. plugins: [
  13. new HtmlWebpackPlugin({
  14. title: 'Vue App',
  15. favicon: path.join(__dirname, '../public/favicon.ico'),
  16. template: path.join(__dirname, '../public/index.html'),
  17. }),
  18. ],
  19. };